• 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: Beginner problem with multiple NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginner problem with multiple NSTableView


  • Subject: Re: Beginner problem with multiple NSTableView
  • From: James Housley <email@hidden>
  • Date: Thu, 20 Jan 2005 18:50:07 -0500

On Jan 20, 2005, at 6:29 PM, mmalcolm crawford wrote:


On Jan 20, 2005, at 3:19 PM, James Housley wrote:

[<Feeds 0x3db5e0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key itemlist.

This means exactly what it says -- for some reason an instance of Feeds is being sent a message 'valueForKey:@"itemlist"'. The first question might be, have you misspelled the variable name (e.g. should it be "itemList") -- perhaps you've entered it incorrectly in the column identifier in the tableview? Otherwise, how have you implemented your data source methods (i.e. what's the code for – tableView:objectValueForTableColumn:row:)?

mmalc


I have these two done:

- (int)numberOfRowsInTableView:(NSTableView *)aView
{
	if (aView = Feeds_Required_Files) {
		return _numFeeds;
	}
	else if (aView = Items_Required_Items) {
		return _numItems;
	} else {
		NSLog(@"numberOfRowsInTableView returning 0");
		return 0;
	}
}

- (id)tableView:(NSTableView *)aView
    objectValueForTableColumn:(NSTableColumn *)aCol row:(int)index
{
	if (aView = Feeds_Required_Files) {
		NSString *key = [aCol identifier];
		return [[_feedlists objectAtIndex:index] valueForKey:key];
	}
	else if (aView = Items_Required_Items) {
		NSString *key = [aCol identifier];
		return [[_itemlists objectAtIndex:index] valueForKey:key];
	} else {
		NSLog(@"numberOfRowsInTableView returning nil");
		return nil;
	}
}

Would I need to add something like:

- (id)datasource:(NSTableView *)aView
{
	if (aView = Feeds_Required_Files) {
		return Feeds_Required_Files;
	else if (aView = Items_Required_Items) {
		return Items_Required_Files;
	} else {
		NSLog(@"datasource returning nil");
		return nil;
	}
}

With similar code for the "delegate"?  Is that what I need?

Jim

--

/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
 X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
email@hidden      http://www.FreeBSD.org     The Power to Serve
email@hidden  http://www.TheHousleys.net
---------------------------------------------------------------------
Do not meddle in the affairs of dragons, for you are crunchy and taste
    good with ketchup.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Beginner problem with multiple NSTableView
      • From: mmalcolm crawford <email@hidden>
    • Re: Beginner problem with multiple NSTableView
      • From: Guy English <email@hidden>
References: 
 >Beginner problem with multiple NSTableView (From: James Housley <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: Jonathan Jackel <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: James Housley <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Beginner problem with multiple NSTableView
  • Next by Date: Re: Creating Cocoa Windows from Command Line Apps
  • Previous by thread: Re: Beginner problem with multiple NSTableView
  • Next by thread: Re: Beginner problem with multiple NSTableView
  • Index(es):
    • Date
    • Thread