xcode 7 generates core data entity with additional CoreDataProperties category

后端 未结 3 1608
误落风尘
误落风尘 2021-01-31 15:45

I have strange new feature in xcode 7, when I generate new NSManagedObject subclass then xcode create two classes: entity and their CoreDataProperties category, which contain fu

3条回答
  •  臣服心动
    2021-01-31 16:25

    For Swift and Xcode 7 it is the same as the answer from Leszek S but only 2 files are created initially:

    • DBUser.swift
    • DBUser+CoreDataProperties.swift

    Later, if you make changes to the CoreData model and regenerate the NSManagedObject subclass only the DBUser+CoreDataProperties.swift gets updated. DBUser.swift is left untouched.

    So put all your code in DBUser.Swift.

提交回复
热议问题