• 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
What is wrong here?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What is wrong here?


  • Subject: What is wrong here?
  • From: "Peter Karlsson" <email@hidden>
  • Date: Wed, 18 Jun 2003 08:36:07 +0000

Dear list!

I am trying to use different data sources with on NSTableView.

Look at this code snippet:

records6 = [[NSMutableArray alloc] initWithObjects: @"Cocoa", @"Is", @"Good", nil];
records7 = [[NSMutableArray alloc] initWithObjects: @"Cocoa", @"Is", @"Great", nil];
myBigArray = [[NSMutableArray alloc] initWithObjects:records6, records7, nil];

- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [[myBigArray objectAtIndex:index] count];
}

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
id theRecord, theValue;
theRecord = [[myBigArray objectAtIndex:index] objectAtIndex:rowIndex];
theValue = [theRecord objectForKey:[aTableColumn identifier]];
return theValue;
}

It works as long as my index is 0, but if the index is 1 I get a error message saying:
*** -[NSConstantString objectForKey:]: selector not recognized

What can be wrong here?

Peter

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: What is wrong here?
      • From: Sherm Pendley <email@hidden>
    • Re: What is wrong here?
      • From: j o a r <email@hidden>
  • Prev by Date: NSImage drawInRect:
  • Next by Date: Re: What is wrong here?
  • Previous by thread: Re: NSImage drawInRect:
  • Next by thread: Re: What is wrong here?
  • Index(es):
    • Date
    • Thread