Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'll do this backwards: first some things for you to check and then some ideas.</p> <p>Check <a href="https://stackoverflow.com/questions/10427340/extending-core-data-generated-nsmanagedobject-classes">my own question</a>.</p> <p>I'd say that on your custom categories you can do the interface between the JSON representation and your classes.</p> <p>You should also check <a href="http://restkit.org" rel="nofollow noreferrer">RestKit</a> which can do already much of what you need.</p> <hr> <p>You're talking about two separate problems as far as I can understand:</p> <ol> <li>Syncing local data to the server based on connectivity;</li> <li>Using model classes.</li> </ol> <h2>Problem 1</h2> <p>I think you should have a class with the common code and each of your model classes should have its own mapping (to map between model and JSON) and saving methods.</p> <p>Another class, that may be your DataEngine class, takes care of saving the right objects at the right time. Take a look at <a href="http://restkit.org" rel="nofollow noreferrer">RestKit</a> as it helps with the mapping and the saving. I'm not sure about the syncing though.</p> <h2>Problem 2</h2> <p>I think you should have model classes. It helps a lot to work with objects and you have then a place to save methods for finding different kinds of data.</p> <p>For this <a href="https://stackoverflow.com/questions/10427340/extending-core-data-generated-nsmanagedobject-classes">my question</a> might be useful for you because you can create a CoreData model with generated class files and update it whenever you want while keeping your custom code.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload