Core Data - how to generate CoreDataGeneratedAccessors?

后端 未结 4 1270
南方客
南方客 2021-02-15 11:29

I\'ve gone through apple dev website, google and stack overflow to figure out the basics behind CoreDataGeneratedAccessors.

I\'m using Xcode 4.2 and core data. I created

相关标签:
4条回答
  • 2021-02-15 11:49

    1)created a new version of the Core Data Model via Xcode.

    2)Fix the relationship (added a new relationship between the two.https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/HowManagedObjectsarerelated.html)

    3)re-created the NSManagedObject subclass

    0 讨论(0)
  • 2021-02-15 11:55

    Have a look here:

    https://github.com/rentzsch/mogenerator

    This little tool will generate the accessor classes for you - I use it in quite some projects and it works great!

    0 讨论(0)
  • 2021-02-15 12:01

    Have you checked the switch "To-Many Relationship" in the relationship properties?

    0 讨论(0)
  • 2021-02-15 12:02

    @Julien's answer was part of the solution, but here is how I solved it:

    1. Make sure that you have a to-many relationship.
    2. If you already made a class for your entity, delete it, then with your xcdatamodel open, go to Editor -> create NSManagedObject subclass, and follow the wizard.

    The class that is generated will have CoreDataGeneratedAccessors that you are looking for.

    0 讨论(0)
提交回复
热议问题