Core Data Regeneration

Discussion in 'iOS Programming' started by nashyo, Sep 6, 2012.

  1. macrumors 6502

    nashyo

    Joined:
    Oct 1, 2010
    Location:
    Bristol
    #1
    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?
     
  2. macrumors 68000

    Reason077

    Joined:
    Aug 14, 2007
    #2
    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.
     

Share This Page