Re: Table view with multiple columns
Re: Table view with multiple columns
- Subject: Re: Table view with multiple columns
- From: Andrew Farmer <email@hidden>
- Date: Fri, 21 Aug 2009 22:39:18 -0700
On 21 Aug 2009, at 03:53, Massimiliano Gargani wrote:
I have a mutable array with inside something like "luke","email@hidden
","mark","email@hidden", ......
...
- (id) tableView: (NSTableView*) tableView
objectValueForTableColumn: (NSTableColumn *) tableColumn row: (int)
row
{
id record, result;
record = [namesList objectAtIndex:row];
result = [record objectForKey:[tableColumn identifier]];
return result;
}
when I run the app I get TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION
Well... yes. NSString doesn't have an objectForKey method, so it
throws an exception. I'd recommend restructuring your data store as an
array of dictionaries, or an array of arrays - anything, really,
besides an interleaved array.
If you're dead-set on storing things that way, though, you'll need to
handle that properly in your objectValueForTableColumn method.
_______________________________________________
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