• 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
Re: Table view with multiple columns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Table view with multiple columns


  • Subject: Re: Table view with multiple columns
  • From: Massimiliano Gargani <email@hidden>
  • Date: Sat, 22 Aug 2009 17:15:05 +0200

Thanks,

NSDictionary is my friend.

Max

Il giorno 22/ago/09, alle ore 07:39, Andrew Farmer ha scritto:

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


References: 
 >Table view with multiple columns (From: Massimiliano Gargani <email@hidden>)
 >Re: Table view with multiple columns (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: Displaying svg image with WebKit - scaling issues
  • Next by Date: Re: Displaying svg image with WebKit - scaling issues
  • Previous by thread: Re: Table view with multiple columns
  • Next by thread: NSSegmentedCell and strange selected segment behavior
  • Index(es):
    • Date
    • Thread