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

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


  • Follow-Ups:
    • Re: Table view with multiple columns
      • From: Andrew Farmer <email@hidden>
    • Re: Table view with multiple columns
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Choose applications dialog?
  • Next by Date: NSSegmentedCell and strange selected segment behavior
  • Previous by thread: Re: Choose applications dialog?
  • Next by thread: Re: Table view with multiple columns
  • Index(es):
    • Date
    • Thread