On 15/05/2009, at 8:53 PM, Kyle Sluder wrote:

On Fri, May 15, 2009 at 6:41 AM, Steven Hamilton <o...@scorch.net> wrote:
Hmm, clearly I'm doing it all wrong. I assumed (from past problems) that the delegate method can't return a value to an popup in a tableView and that you use the opportunity of the method call to set the selectedIndex. I've now
changed the code to the standard;

NSTableView has a delegate method called
-tableView:willDisplayCell:forTableColumn:row: that you can use to
change the selected item in the NSPopUpButtonCell, or even replace the
menu items in that cell.  Relying on the order of calls to the
-tableView:objectValueForTableColumn:row: data source method is prone
to breakage, and causing KVO notifications inside of it is slow.

Hmm, so we're saying that - tableView:willDisplayCell:forTableColumn:row: cannot be used to set the value I want displayed in an NSPopupCell in a column? I must use - tableView:willDisplayCell:forTableColumn:row: instead which, as far as I can see, will be called just as often.

I'm also not relying on having the columns called in order. I can't see where you can see that but perhaps it was in my explanation. The popup is also not setting any content via bindings. It's done manually via the - (void)tableView:(NSTableView *)tableView setObjectValue: (id)newValue forTableColumn:(NSTableColumn *)tableColumn row:(int)row method.
_______________________________________________

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