I have a table with one column. This column uses NSButtonCells.

I have an array controller whose object class is NSMutableDictionary. It uses 
two keys: "value" and "state". Value is the string that will be used as the 
title for a button cell. State is the state of the button cell, which is a 
check box. The states being checked or unchecked (NSOnState or NSOffState).

The table column's value is bound to the array controller. The controller key 
being "arrangedObjects" and the model key path being "value".

The NSButtonCell (which is attached to the column via Interface Builder) has 
its value bound to the array controller as well. The controller key is 
"selection" and the model key path is "state".

Finally, I have a table delegate method which is as follows...


- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell 
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
  NSArray                *arrangedObjects = [myArrayController arrangedObjects];
  NSMutableDictionary    *anObject = [arrangedObjects objectAtIndex:rowIndex];
  NSString               *myValueString = [anObject objectForKey:@"value"];


  [aCell setTitle:myValueString];
}


Ideally, this would display all of the check boxes in the table column, with 
their respective titles and their current state (checked or unchecked).

Everything looks perfect when I first run the app. The check boxes show their 
correct state and the titles are correct. The problem is when I click on a 
check box. If I check a box, its title changes to "1" and if I uncheck a box, 
its title changes to "0". Has anyone had this problem before?




      
_______________________________________________

Cocoa-dev mailing list ([email protected])

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]

Reply via email to