• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView/NSPopUpButtonCell Mysteries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView/NSPopUpButtonCell Mysteries


  • Subject: Re: NSTableView/NSPopUpButtonCell Mysteries
  • From: Daniel Todd Currie <email@hidden>
  • Date: Mon, 16 Feb 2004 14:18:24 -0800

So the only way to get the popup cell's selected item is by checking the data source array? If I do this, I have to make some awfully ugly code when I want to return the selected NSMenuItem, in pseudocode:

[[[table column] datacell] menuItemAtIndex:[[[tableData objectAtRow] objectForKey:column] intValue]]

Is there any better way to access the selected item directly? Thanks.


On 2004 Feb 16, at 03:40, Stephane Sudre wrote:

On Monday, February 16, 2004, at 09:46 AM, Daniel Todd Currie wrote:

Here's an odd problem and my hypothesis as to the cause:

I have two NSLogs at a place in my source where I am updating the menu for an NSPopUpButtonCell:

NSLog(@"table data: %i", [[[targetTable tableColumnWithIdentifier:@"archive"] dataCellForRow:[targetTable selectedRow]] indexOfSelectedItem]);

You're getting access to the prototype cell mostly, not the cell of the row. So the value you're getting is not the value for the row in most of the cases.

It's in the documentation more or less. (maybe more less than less more).
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTableView/NSPopUpButtonCell Mysteries
      • From: mmalcolm crawford <email@hidden>
References: 
 >Re: NSTableView/NSPopUpButtonCell Mysteries (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Finding the line containing the cursor...
  • Next by Date: Re: NSImage and flipping
  • Previous by thread: Re: NSTableView/NSPopUpButtonCell Mysteries
  • Next by thread: Re: NSTableView/NSPopUpButtonCell Mysteries
  • Index(es):
    • Date
    • Thread