• 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
NSTableView and check boxes (for the hundredth time)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView and check boxes (for the hundredth time)


  • Subject: NSTableView and check boxes (for the hundredth time)
  • From: Jan Van Tol <email@hidden>
  • Date: Wed, 2 Oct 2002 19:50:40 -0500

I know this has been discussed MANY times before on this list, but I've read the archives relating to this, and it still won't work. When I run this, I just get a column of zeros instead of checkboxes. What am I doing wrong? Here is the code I'm trying to use:

- (void)awakeFromNib {
NSTableColumn *checkboxColumn;

checkboxColumn=[tableView tableColumnWithIdentifier:@"status"];
if (checkboxColumn)
{
NSButtonCell *protoCell;

protoCell=[[NSButtonCell alloc] init];
[protoCell setButtonType:NSSwitchButton];
[protoCell setImagePosition:NSImageOnly];
[protoCell setTitle:@""];
[checkboxColumn setDataCell:protoCell];
}
[tableView setHeaderView:nil];
[tableView setAction:@selector(clicked:)];
[tableView setTarget:self];
[tableView reloadData];
}

...

- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
NSString *identifier = [aTableColumn identifier];
if ([identifier isEqualToString:@"myOtherColumn"]) {
//return stuff for my other column here...
}

if ([identifier isEqualToString:@"status"]) {
return [NSNumber numberWithBool: NO];
}
return nil;
}


The code is from OpenUp. Thanks in advance for any help.

-Jan Van Tol
_______________________________________________
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 and check boxes (for the hundredth time)
      • From: Vladimir Pilipyuk <email@hidden>
    • Re: NSTableView and check boxes (for the hundredth time)
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Invoking Webbrowser within Help HTML
  • Next by Date: Re: [semi-newbie] Message sent to NSWindowController after complete window load
  • Previous by thread: Re: cocoa-dev digest, Vol 2 #1329 - 19 msgs
  • Next by thread: Re: NSTableView and check boxes (for the hundredth time)
  • Index(es):
    • Date
    • Thread