Re: Managed Object Context Reference
Re: Managed Object Context Reference
- Subject: Re: Managed Object Context Reference
- From: Richard Somers <email@hidden>
- Date: Tue, 1 Jun 2010 11:31:53 -0600
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 (email@hidden)
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:
This email sent to email@hidden