Re: Adding an observer to an NSOperation crashes my app.
Re: Adding an observer to an NSOperation crashes my app.
- Subject: Re: Adding an observer to an NSOperation crashes my app.
- From: Kyle Sluder <email@hidden>
- Date: Sat, 14 Jan 2012 14:32:45 -0800
On Jan 14, 2012, at 1:25 PM, G S <email@hidden> wrote:
> Thanks, Mike.
>
> There's nothing in the console. The whole call stack at the time of
> the crash is this (when I create the operation on the main thread):
>
> #0 0x00396336 in -[NSOperation observationInfo] ()
> #1 0x0036823a in _NSKeyValueRetainedObservationInfoForObject ()
> #2 0x00379c98 in -[NSObject(NSKeyValueObserverRegistration)
> _addObserver:forProperty:options:context:] ()
> #3 0x0037870d in -[NSObject(NSKeyValueObserverRegistration)
> addObserver:forKeyPath:options:context:] ()
> #4 0x000065e9 in __70-[StashpixAppDelegate
> observeValueForKeyPath:ofObject:change:context:]_block_invoke_0
> #5 0x01aae445 in _dispatch_call_block_and_release ()
> #6 0x01ab04f0 in _dispatch_main_queue_callback_4CF ()
> #7 0x01f51833 in __CFRunLoopRun ()
> #8 0x01f50db4 in CFRunLoopRunSpecific ()
> #9 0x01f50ccb in CFRunLoopRunInMode ()
> #10 0x022d8879 in GSEventRunModal ()
> #11 0x022d893e in GSEventRun ()
> #12 0x00d6fa9b in UIApplicationMain ()
It really sounds like you have a zombie somewhere. Or you didn't unregister a KVO observer before it was deallocated. If you deallocate an *observed* object before unregistering observers, KVO will bark at you. If you deallocate the *observer*, KVO doesn't warn you.
--Kyle Sluder_______________________________________________
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