Xcode 8 generates broken NSManagedObject subclasses for iOS 10

后端 未结 22 909
栀梦
栀梦 2020-11-27 11:13

I updated my iOS app project recently to iOS 10. Now I\'m trying to change the Core Data Model of my app but the new NSManagedObject subclasses which Xcode generates are bro

22条回答
  •  隐瞒了意图╮
    2020-11-27 11:57

    I have a Flights Entity and these settings in the Data Model Inspector worked for me :

    1. Set the Name to nothing(You will see some grayed out text of "NSManagedObject"). The default will be written as "Flights" just remove that.

    2. Nothing in the module."Global Namespace" greyed out is what you will see.

    3. Codegen to Manual/None.

    4. Then Goto Editor -> Create NSManagedObject Subclass to create the swift files

    5. Rename the Flights+CoreDataClass.swift to just Flights.swift

    Here's the link to the Screenshot(For some reason imgur was rejecting it :( ) https://drive.google.com/file/d/0B8a3rG93GTRedkhvbWc5Ujl4Unc/view?usp=sharing

提交回复
热议问题