• 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: 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


  • Follow-Ups:
    • Re: Table view with multiple columns
      • From: Massimiliano Gargani <email@hidden>
References: 
 >Table view with multiple columns (From: Massimiliano Gargani <email@hidden>)

  • Prev by Date: Re: Bindings & Reverting Properties
  • Next by Date: Re: debug control not reaching init method
  • Previous by thread: Re: Table view with multiple columns
  • Next by thread: Re: Table view with multiple columns
  • Index(es):
    • Date
    • Thread