Xcode 8 generates broken NSManagedObject subclasses for iOS 10

后端 未结 22 932
栀梦
栀梦 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 12:02

    In Data Model Inspector select Current Product Module under 'Module' and Manual/None under 'Codegen'. (This allows you to edit subclass files and to regenerate CoreDataProperties.swift when you modify your attributes under the same entity.)

    You can then choose Create NSManagedObjectSubclass under Editor menu. Xcode will create 2 files for you YourEntity+CoreDataClass.swift and YourEntity+CoreDataProperties.swift. Notice if you don't have the latest Xcode (8.2.1), any optional/nonoptional properties that you set in your Model Inspector will not show up correctly. You can edit in YourEntity +CoreDataProperties.swift file.

提交回复
热议问题