• 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: Is there a trick to NSTableViews?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a trick to NSTableViews?


  • Subject: Re: Is there a trick to NSTableViews?
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 12 Sep 2005 23:44:41 -0600


On Sep 12, 2005, at 10:52 PM, Dustin Robert Kick wrote:

2005-09-12 23:08:24.543 PODock2[7010] *** -[FoodItem copyWithZone:]: selector not recognized [self = 0x350240]

This exception is raised if the program tries to send a -copy message to an object that does not conform to the NSCopying protocol.


2005-09-12 23:08:24.554 PODock2[7010] An uncaught exception was raised
2005-09-12 23:08:24.559 PODock2[7010] *** -[FoodItem copyWithZone:]: selector not recognized [self = 0x350240]
2005-09-12 23:08:24.560 PODock2[7010] *** Uncaught exception: <NSInvalidArgumentException> *** -[FoodItem copyWithZone:]: selector not recognized [self = 0x350240]


PODock2 has exited due to signal 5 (SIGTRAP).

The application crashes if an exception is raised & not caught.

[super init];

That should be "self = [super init]" and you should check the return type, because the superclass may return nil.


  [items addObject:chimi];
  [items addObject:fajitas];

Here you're adding two items to an array that hasn't been allocated yet. You need to allocate & initialize an object before you can use it, and you must release it when it will no longer be used.


- (id)tableView:(NSTableView *)tableView
objectValueforTableColumn:(NSTableColumn *)tableColumn
        row:(int)row
{
  NSString * identifier = [tableColumn identifier];
  FoodItem * item = [items objectAtIndex:row];
  return [item valueForKey:identifier];
}

Did you set the table column identifiers in the nib? This code does nothing if you didn't assign the table columns unique identifiers.


Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________
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


References: 
 >Is there a trick to NSTableViews? (From: Dustin Robert Kick <email@hidden>)

  • Prev by Date: Re: Is there a trick to NSTableViews?
  • Next by Date: Re: Reading too many Files into Array returns Nil
  • Previous by thread: Re: Is there a trick to NSTableViews?
  • Next by thread: 2 TableViews - 1 Controller - Best Practice?
  • Index(es):
    • Date
    • Thread