NSManagedObject subclass attempts to import NSManagedObject.h
| Originator: | brock | ||
| Number: | rdar://20623474 | Date Originated: | |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | |
| Classification: | Reproducible: |
Summary: In a basic app using Core Data, I created two entities in the data model, with a relation between them, then created NSManagedObject subclasses of both. One of the implementation files attempts a failing import: #import "NSManagedObject.h" This should be: #import <CoreData/NSManagedObject.h> But more importantly, this isn’t needed, because the header file imports <CoreData/CoreData.h>. The attached project shows the problem. Steps to Reproduce: 1. Create a single view iOS app that uses Core Data. 2. Add entities to the data model to model a basic to-do list: Task and List entities, with a one-to-many relationship between them. 3. Use the Editor > Create NSManagedObject subclass menu item to create classes for these two entities 4. Attempt to run the app. Build will fail because NSManagedObject.h cannot be found Expected Results: Generated NSManagedObject subclass files will not attempt to import NSManagedObject.h Actual Results: Generated NSManagedObject subclass files DO attempt to import NSManagedObject.h, causing a build failure Regression: Notes: The attached project shows the problem. I did not make any changes to the List.h/m or Task.h/m after using the “Create NSManagedObject subclass” menu item to create them.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!