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

checkbox in nstableview


  • Subject: checkbox in nstableview
  • From: Bart Beulen <email@hidden>
  • Date: Sat, 14 Jun 2008 16:59:48 +0200

Hi,

I've got an NSTableView with in the first column filled with checkboxes (NSButtonCell), 2nd and 3rd columns have an NSImage and NSString.
The NSImage and NSString column work fine. However, I cannot succeed to set the checkboxes and edit the checkboxes. I'm using this code:



-(id)tableView:(NSTableView *)tv objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row { NSString * identifier = [tableColumn identifier]; if (identifier) { return [[pois objectAtIndex:row] valueForKey:identifier]; } else { return 0; }; }

- (void)tableView:(NSTableView *)tv setObjectValue:(id)value forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
NSString * identifier = [tableColumn identifier];
if (identifier) {
[[pois objectAtIndex:row] setValue:value forKey:identifier];
}
}


The identifier of the checkbox column is: POIenabled, I'm trying to use the following method to get and set the value:

-(void)setPOIEnabled:(NSInteger *)penabled
{
	[penabled retain];
	[POIEnabled release];
	POIEnabled = penabled;
}

 - (NSInteger *)POIEnabled
 {
 return POIEnabled;
 }

I think the actual problem is that I have to get and set the value of the checkbox in another way (not using NSInteger, I tried also using a BOOL but that doesn't work).
I searched online but could not find an actual solution or usable hints.


Kind regards,

Bart
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: checkbox in nstableview
      • From: Graham Cox <email@hidden>
  • Prev by Date: Converting string to encoding
  • Next by Date: Re: checkbox in nstableview
  • Previous by thread: Re: Converting string to encoding
  • Next by thread: Re: checkbox in nstableview
  • Index(es):
    • Date
    • Thread