invalid redeclaration in auto code generate NSManagedObject Subclass Swift 3

前端 未结 9 1523
情书的邮戳
情书的邮戳 2020-12-08 09:07

Using Version 8.1 of Xcode.

Create an entity named \"MapRegionObject\" in .xcdatamodeld file.

Using auto code generator, click Editor on the navigation bar -

9条回答
  •  隐瞒了意图╮
    2020-12-08 09:41

    Don't fight the with Xcode on this unless you really need to alter your generated properties, doing so will just leave you frustrated.

    Think of the auto-generated class as any other class in your application. If you need to add functionality to your managed object class, simply change your class definition into an extension and extend your object.

    change your class:

    class MyManagedObject : NSManagedObject { /* implementation*/ }
    

    to an extension:

    extension MyManagedObject { /* implementation */ }
    

提交回复
热议问题