• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ARC and NSObjectController bindings through file's owner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: ARC and NSObjectController bindings through file's owner
      • From: Jerry Krinock <email@hidden>
    • Re: ARC and NSObjectController bindings through file's owner
      • From: Quincey Morris <email@hidden>
    • Re: ARC and NSObjectController bindings through file's owner
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Auto-Layout Strangeness
  • Next by Date: Re: ARC and NSObjectController bindings through file's owner
  • Previous by thread: Re: How to get the time zone of a parsed date/time string?
  • Next by thread: Re: ARC and NSObjectController bindings through file's owner
  • Index(es):
    • Date
    • Thread