Managed Object Context fails to create permanent IDs
| Originator: | khakionion | ||
| Number: | rdar://12970136 | Date Originated: | 07-Jan-2013 05:18 PM |
| Status: | Open | Resolved: | |
| Product: | OS X SDK | Product Version: | 10.8 |
| Classification: | Serious Bug | Reproducible: | Always |
07-Jan-2013 05:18 PM Michael Herring: Summary: The attached NSPersistentDocument-based app will create an entity, and attempt to obtain a permanent ID for it. This fails when the document is newly-created, because an autosave hasn't yet happened (and thus, there are no persistent stores via which a permanent ID can be made). Uncomment lines 56 and 57 in CDDocument.m and it works. Since there is a persistent store (even an in-memory one), the permanent IDs are generated. The problem seems to be that Core Data will not implicitly create a persistent store when permanent IDs are requested, leading to a failure. Steps to Reproduce: - Build and run the attached app on OS X 10.8. - Create a new document. - Click "do both." Expected Results: The output should illustrate the creation of a new object, followed by information about its newly-permanent ID. Actual Results: An error message is logged, citing problems with persistent stores. Regression: Unknown. Notes: The test case does not exhibit the issue if an autosave is "induced"; that is, click "Create NSManagedObject," then switch to another application, then switch back, and click "Obtain Permanent ID." Be sure you're reproducing with a new document in the test app, without switching apps. 07-Jan-2013 05:18 PM Michael Herring: 'PermanentOID.zip' was successfully uploaded
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!