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 (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]