Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nashyo

macrumors 6502
Original poster
Oct 1, 2010
299
0
Bristol
When creating subclasses of NSManagedObjects and replacing existing subclasses, using XCodes autoregenerating tool, are category methods reinserted into the new subclasses?

If not, how do you preserve any methods you insert into these classes?
 

Reason077

macrumors 68040
Aug 14, 2007
3,606
3,644
XCode overwrites the generated files each type you run the "Create NSManagedObject subclasses..." command.

So, if you want to add your own methods to NSManagedObject subclasses, it's best to put them in a category, in a separate file. That way, XCode won't overwrite them when you regenerate.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.