On Jan 13, 2010, at 16:12, Daniel Wambold wrote:

> Nevertheless, I agree that the situation seems to suggest that the File > 
> Open ("load") method that is being invoked by the NSPersistentDocument is 
> creating a new managed object context that is not being attached to the 
> controller. Despite my efforts to force this issue (such as posting the new 
> MOC in a notification object), it fails. I assume this is because I was using 
> the NSPersistentDocument persistent store assignment method, which occurs 
> before the Nib is reconstituted, meaning that the value is lost in the 
> initialization.

The next step is to narrow down the problem to a single area. ATM, we don't 
even know if it's related to nib loading or to Core Data. You may need to 
simplify your code to find out.

> I don't know if this is a clue, but I have never been able to get this 
> program to respond to the request for [[NSApp delegate] 
> managedObjectContext]. I DO have a delegate to the Application, but I have 
> not yet done anything with it. Could this be part of the problem?

The application delegate has no inherent knowledge of managed object contexts, 
and anyway -- in the case of a NSPersistentDocument-based application -- the 
MOC is per-document, not per-application. ' [[NSApp delegate] 
managedObjectContext]' isn't well-defined in such an application.


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to