Re: Binding Exception
Re: Binding Exception
- Subject: Re: Binding Exception
- From: Keary Suska <email@hidden>
- Date: Mon, 15 Sep 2014 14:52:08 -0600
On Sep 15, 2014, at 2:42 PM, Richard Charles <email@hidden> wrote:
> I have a binding that throws an Objective-C exception but the console displays no output and the application does not crash but rather the application runs fine. Enabling NSBindingDebugLogLevel 1 does not help, the console still displays nothing. I am using Xcode 5.1.1 with the All Exceptions breakpoint enabled.
>
> [self bind:@"allowSelection"
> toObject:_customView.window.windowController
> withKeyPath:@“widgetControllerManager.activeWidgetController.allowSelection"
> options:nil];
>
> The stack trace looks like this.
>
> #0 0x00007fff909f0e4a in objc_exception_throw ()
> #1 0x00007fff8a3f710c in +[NSException raise:format:] ()
> #2 0x00007fff94b152a7 in -[NSObject(NSKeyValueCoding) setNilValueForKey:] ()
> #3 0x00007fff94a4472e in -[NSObject(NSKeyValueCoding) setValue:forKey:] ()
> #4 0x00007fff88549f0d in -[NSObjectParameterBinder _updateObject:observedController:observedKeyPath:context:] ()
> #5 0x00007fff88540f08 in -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] ()
>
> This application contains lots of programatic bindings similar to this one. However this is the only one which throws an exception.
>
> Should I be concerned about this?
Yes, The exception will leave your app in an invalid state.
> Is there anyway to debug this?
The breakpoint catches before the exception would be logged to console. Simply keep clicking the "continue" button in the debugger until it outputs the exception. Then read the Key-Value Coding guide on when setNilValueForKey: is called and how you can handle it.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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