Short answer is yes, you can. How? You can find a useful discussion Organising Core Data for iOS.
The long answer can be grabbed within the documentation.
NSManagedObject
is a generic class that implements all the basic behavior required of a Core Data model object. It is not possible to use instances of direct subclasses ofNSObject
(or any other class not inheriting fromNSManagedObject
) with a managed object context. You may create custom subclasses ofNSManagedObject
, although this is not always required. If no custom logic is needed, a complete object graph can be formed withNSManagedObject
instances.A managed object is associated with an entity description (an instance of
NSEntityDescription
) that provides metadata about the object (including the name of the entity that the object represents and the names of its attributes and relationships) and with a managed object context that tracks changes to the object graph. It is important that a managed object is properly configured for use with Core Data. If you instantiate a managed object directly, you must call the designated initializer (initWithEntity:insertIntoManagedObjectContext:
).
About your question, it depends on what you need to achieve. If your goal is to perform a sync mechanism between your device and the server, you should set up 1) a model with a TrackInfo
entity 2) a Core Data stack that relies on a persistent store like SQLite. Then you should modify TrackInfo
to take into account modifications to that entity. For example, a dirty
flag property (0
or 1
) or a timestamp
. When you do a modification on your TrackInfo
you update that property. When the connection is restored you need to query against that property and sync with the server. If you choose the timestamp
, the server should say what is the latest timestamp to query against.