On Apr 19, 2011, at 00:41, Ben Golding wrote: > I am a bit stumped. I have an array controller which I have hooked up to a > pop-up button and that works quite well. The members of the array are > NSStrings but I would like to reformat them when they're displayed by the > pop-up button. Seems fairly straightforward, I thought I'd just write a > little transformer to do that. > > I plugged everything together and was surprised that that the transformer was > raising an exception because it was being passed an NSObjectControllerProxy > as its argument, not an NSString as I'd been expecting.
Can you list explicitly all the NSPopUpButton bindings you're using? The bindings for popup buttons are very nasty. You have to figure out what/whether to bind 'content', 'contentObjects' and 'contentValues'. Only after you've got that right can you decide which of the 'selected...' bindings you want to use. 'content', 'contentObjects' and 'contentValues' correspond to controller proxies, strings and represented objects, but I couldn't tell you off-hand which corresponds to what. It's anybody's guess whether the documentation (http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSPopUpButton.html) is actually correct -- several of the pages in that document are wrong and/or incomplete -- and it's a puzzle sometimes to understand what the documentation even means. TBH, I've generally found it easier *not* to use bindings for NSPopUpButton content, but provide it the traditional way ('-[NSPopUpButton insertItem...]'), and just use a binding for 'selectedIndex'. But maybe I'm just a coward. _______________________________________________ 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