ios - How do I make the model classes in my library reusable for Core Data? -


if create reusable ios library how create model objects useable core data i.e. model objects inherit nsobject or nsmanagedobject?

at least know won't able override isequal: , hash since nsmanagedobject uses them.

the preferred way let core data management features in xcode create model classes you, add methods generated classes necessary. example, if had model class 'thing', might:

  1. create core data model thing entity , appropriate attributes
  2. select thing entity , choose editor > create nsmanagedobject subclass
  3. save file; you'll new thing.h , thing.m in project
  4. edit classes normal, being careful not override of these methods

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -