Table view with multiple columns
Table view with multiple columns
- Subject: Table view with multiple columns
- From: Massimiliano Gargani <email@hidden>
- Date: Fri, 21 Aug 2009 12:53:17 +0200
Hi everybody,
I'm learning cocoa to write a little app. I'm facing a problem I can't
solve by myself.
I've red loads of tutorials, post, specification, but I can't make it
work.
I have a mutable array with inside something like
"luke","email@hidden","mark","email@hidden", ......
I create a 2 columns table, first column has identifier "name", second
col ha identifier "email"
here's my code:
- (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
if I comment out the result and return record it work but i get:
name | email
-------------------------------------------------
luke | luke
email@hidden | email@hidden
mark | mark
email@hidden | email@hidden
it seems that result = [record objectForKey:[tableColumn identifier]];
cause the problem.
Any help is appreciated.
Thanks,
Max
_______________________________________________
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