Re: Is there a trick to NSTableViews?
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