On Fri, Jul 22, 2011 at 11:26 PM, Jerry Krinock <je...@ieee.org> 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
clarkc...@gmail.com
_______________________________________________

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

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

Reply via email to