On May 31, 2010, at 11:53 PM, Quincey Morris wrote:

You've created another scenario by making your view need the managed object context (probably during 'drawRect:' at least?). If the view has to redraw when your application is in the background, you'll hit your assert.

I think something along this line of reasoning was the cause of my nil document. I have not been able to reproduce it but it seems plausible.

Notice also this uncovers a more serious bug in your current design. If the view has to redraw when another of your document windows is frontmost, it's going to draw with the wrong managed object context.

Going via the window controller seems like the best bet. Just pay attention to the times when objects in the referencing key path chain might be nil.

I have changed to using the window controller. Thanks for the insight.

--Richard

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to