• 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
Select checkbox in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Select checkbox in NSTableView


  • Subject: Select checkbox in NSTableView
  • From: Richard Salvatierra <email@hidden>
  • Date: Fri, 11 Nov 2005 16:41:22 -0500

I have an NSTableView of 4 columns.  The first of which is a checkbox.

id checkboxCell = [[NSButtonCell alloc] initTextCell: @""];
[checkboxCell setButtonType: NSSwitchButton];
[[myTableView tableColumnWithIdentifier: @"checkbox"] setDataCell: checkboxCell];


I want to add a button that checks all of the checkboxes for each row. I tried:
int theIndex;
int rowCount = [clientList numberOfRows];
for(theIndex=0; theIndex < rowCount; theIndex++){
NSButtonCell *aCell = [clientList tableColumnWithIdentifier:@"checkbox"] dataCellForRow:theIndex];
[aCell setState:NSOnState];
NSLog(@"%@", [aCell state]);
}


The NSLog print out of each aCell is the same object. Is this the prototype of the tableColumn. How do I get each columns checkbox to set the state?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Select checkbox in NSTableView
      • From: Jim Correia <email@hidden>
    • Re: Select checkbox in NSTableView
      • From: Ryan Britton <email@hidden>
    • Re: Select checkbox in NSTableView
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Predicate oddness
  • Next by Date: Re: Select checkbox in NSTableView
  • Previous by thread: Predicate oddness
  • Next by thread: Re: Select checkbox in NSTableView
  • Index(es):
    • Date
    • Thread