I have an iOS app containing a Core Data model with 6 entities. The entity Name
is set up as follows:
Class Name: Name
Regarding Problem 1, setting the Codegen popup in the Inspector for an entity in an .xcdatamodel is supposed to work like this:
Category/Extension tells Xcode to generate one file, ClassName+CoreDataGeneratedProperties.
Class Definition tells Xcode to generate two files, the above-named file, plus ClassName+CoreDataClass.
However, there appears to be a bug, in Xcode 8.2. If, after changing one of these popups, you simply Build (⌘B) or Run (⌘R), your changes will not take effect. For example, if you changed from Class Definition to Category/Extension and even manually deleted the second file, it will reappear. You may even find that the popup reverts back to the original setting.
In order for changes in these popups to become effective, you must
During the next build (which may occur automaticallly when the project opens if you have an @IBInspectable in a storyboard), the affected files in Derived Data will be generated or deleted to conform to your new setting.
UPDATE 2016-12-22: Thank you for the comment, Ashley. I've now written up and submitted this to Apple Bug Reporter: 29789727. Update 2017-02-08: Apple has closed 29789727 as it supposedly duplicates 21205277.