• 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
Re: Crash when loading NSViewController view with NSArrayController [solved]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash when loading NSViewController view with NSArrayController [solved]


  • Subject: Re: Crash when loading NSViewController view with NSArrayController [solved]
  • From: Lee Ann Rucker <email@hidden>
  • Date: Sun, 30 Sep 2012 10:57:29 -0700 (PDT)

Weird that you didn't get the warning, but we've switched to the pattern of

[self addObserver:self forKeyPath:@"ctrl.selectedObjects.someString"...

and that's saved countless headaches. You can remove your own observers in dealloc so you never need to worry about when to remove the observer.
--

[ctrl addObserver:self forKeyPath:@"selectedObjects.someString"
options:NSKeyValueObservingOptionNew context:kSomeContext];

but never removed the observer. This caused the crash.

What I don't know is why the runtime didn't manage to warn me about it.
Something like "Object deallocated while still observing key path xxx" or
"Controller being deallocated while an observer is still registered". I saw
those a couple of times, maybe it's because I was observing a proxy?

Anyway, after hunting this damn thing for a couple of days exclusively, I'm
really relieved that it's fixed.

Thanks a lot to you an Kyle for the suggestions!

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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
_______________________________________________

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: Crash when loading NSViewController view with NSArrayController [solved]
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: Crash when loading NSViewController view with NSArrayController [solved] (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: Crash when loading NSViewController view with NSArrayController [solved]
  • Next by Date: Re: Crash when loading NSViewController view with NSArrayController [solved]
  • Previous by thread: Re: Crash when loading NSViewController view with NSArrayController [solved]
  • Next by thread: Re: Crash when loading NSViewController view with NSArrayController [solved]
  • Index(es):
    • Date
    • Thread