• 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: Loop through NSTableView to set NSCell state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loop through NSTableView to set NSCell state


  • Subject: Re: Loop through NSTableView to set NSCell state
  • From: Andy Lee <email@hidden>
  • Date: Sun, 14 Apr 2002 13:28:21 -0400

At 4:44 PM +0200 4/14/02, j o a r wrote:
I would suggest that you set the button state through the table view delegate methods provided, something like this:

- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
if ([[aCell stringValue] isEqualToString:@"someStringValue"]) {
[aCell setNextState]; // If this is the right way to set the state

Onar, you shouldn't use -setNextState, though I know you said you wanted to and joar is just going along with you here. You should figure out which particular state the cell should have and assign that state explicitly. You don't want to make any assumptions about what the *current* state of the cell is -- especially since (I think) the same actual NSCell instance gets reused over and over to display each cell within a column.

--Andy
_______________________________________________
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.

References: 
 >Re: Loop through NSTableView to set NSCell state (From: j o a r <email@hidden>)

  • Prev by Date: Re: Loop through NSTableView to set NSCell state
  • Next by Date: Re: Address Book FrameWork
  • Previous by thread: Re: Loop through NSTableView to set NSCell state
  • Next by thread: Re: Loop through NSTableView to set NSCell state
  • Index(es):
    • Date
    • Thread