Re: Lion doesn't like tricky.key.paths in bindings?
Re: Lion doesn't like tricky.key.paths in bindings?
- Subject: Re: Lion doesn't like tricky.key.paths in bindings?
- From: Clark Cox <email@hidden>
- Date: Sun, 24 Jul 2011 09:05:27 -0700
On Fri, Jul 22, 2011 at 11:26 PM, Jerry Krinock <email@hidden> wrote:
> In Interface Builder, I often set a binding like this:
>
> Bind to: FooController (an NSObjectController, instantiated in nib)
> Controller Key: selection (an instance of Foo)
> Model Key Path: barDate.someFormattingMethod
>
> where 'barDate' is an NSDate attribute of 'foo' and 'someFormattingMethod is, for example, a method I've defined in a category of NSDate which formats the receiver into a string. I realize the normal way to do this is with a value transformer, but someone showed me this trick a few years ago, and I've found it to be more convenient and cohesive than value transformers.
>
> Until Lion. I've had to rip out several of these recently because, upon changing the content object of the FooController object controller, Cocoa will raise an exception and log one of these turds:
>
> Cannot remove an observer <NSObjectController 0x14a2c950> for the key path "barDate.someFormattingMethod" from <Foo 0x12ebbf50>, most likely because the value for the key "barDate" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the Foo class.
Well, is the suggestion correct? That is, is there any way that the
value of barDate could have changed without sending the appropriate
KVO notification (did you, for example change the value of barDate
without going through the setter?)
--
Clark S. Cox III
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