> On May 10, 2016, at 5:04 PM, Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On May 10, 2016, at 16:43 , Roland King <r...@rols.org 
> <mailto:r...@rols.org>> wrote:
>> 
>> Well no he hasn’t
> 
> Correct … no he hasn’t. I mis-edited a longer draft of the post.
> 
>> Now that I've changed things over to use the context value, I get this at 
>> the moment I add an NSOperation to the NSOperationQueue:
>> 
>>     [uploadQueue addOperation:opn]; <-- Thread 1, EXC_BAD_ADDRESS (code=1, 
>> address=0xc)
>> 
>> (lldb) po uploadQueue
>> <NSOperationQueue: 0x17e76d20>{name = 'Upload Queue'}
>> 
>> (lldb) po opn
>> <NSInvocationOperation: 0x17de5890>
>> 
>> (lldb) bt
>> * thread #1: tid = 0x207807, 0x204e3a86 libobjc.A.dylib`objc_msgSend + 6, 
>> stop reason = EXC_BAD_ACCESS (code=1, address=0xc)
>>     frame #0: 0x204e3a86 libobjc.A.dylib`objc_msgSend + 6
>>     frame #1: 0x2151e27e Foundation`-[NSObject(NSKeyValueObservingPrivate) 
>> _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 278
>>     frame #2: 0x214822d0 Foundation`-[NSObject(NSKeyValueObservingPrivate) 
>> _changeValueForKey:key:key:usingBlock:] + 68
> 
> It’s in the middle of handling a change notification. I’d suggest setting a 
> breakpoint at the top of your ‘observeValueForKeyPath:…’ method.
> 

Hmm, I think I may see what the problem is. I assumed 
-dismissViewControllerAnimated: would end up invoking -prepareForSegue: but it 
doesn't, so my -removeObserver: call never got invoked. So when transitioning 
to another ViewController, it would still KVO notify the original VC which was 
no longer being presented.

Adding -removeObserver: to both places seems to have solved this.
-Carl
 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to