ARC and NSObjectController bindings through file's owner
ARC and NSObjectController bindings through file's owner
- Subject: ARC and NSObjectController bindings through file's owner
- From: Sean McBride <email@hidden>
- Date: Wed, 30 Jul 2014 16:33:47 -0400
- Organization: Rogue Research Inc.
Hi all,
I'm slowing moving my GC app to ARC. One runtime error I'm stuck at is:
--------
An instance 0x10f587510 of class MyDocument was deallocated while key value observers were still registered with it.
<NSKeyValueObservance 0x107985ad0: Observer: 0x107985810, Key path: document.managedObjectContext, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x10ee1ac10>
--------
I have:
- a nib who's File's Owner is an NSViewController subclass
- an NSObjectController at the top-level of my nib
- a strong IOOutlet from my NSViewController to the NSObjectController
- the NSObjectController binds its 'managedObjectContext' binding to:
File's Owner.windowController.document.managedObjectContext
It's something about that binding that's causing the trouble. If I remove it, the error goes away.
File's Owner (my NSViewController subclass) responds to 'windowController' because I have a vanilla synthesized weak property relating my NSViewController to its containing window's controller.
It works under GC. I just don't see how this is a problem under ARC... any one have any thoughts?
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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