NSImage cell tanking
NSImage cell tanking
- Subject: NSImage cell tanking
- From: John Timmer <email@hidden>
- Date: Fri, 16 May 2003 13:18:09 -0400
Greetings:
I'm using the following code to create an NSImageCell:
- (NSImageCell *) getCellWithImage: (NSImage *)theImage {
NSImageCell *theCell = [[[NSImageCell alloc] initImageCell: theImage]
autorelease];
[theCell setImageScaling: NSScaleProportionally];
if ( [theCell hasValidObjectValue] )return theCell;
else return nil;
}
And then storing the Image Cell in an NSMutableArray that is used to
populate an NSTableView (I've overridden the - (id)dataCellForRow:(int)row
method in a custom NSTableColumn class in order to mix cell types), so
everything should be retained. Everything works fine until the table gets
redrawn, at which point it tanks with the following:
2003-05-16 13:10:41.010 CocoaTest[18268] NSImageCell's object value must be
an NSImage.
2003-05-16 13:10:41.025 CocoaTest[18268] *** Uncaught exception:
<NSInvalidArgumentException> NSImageCell's object value must be an NSImage.
The image is originally loaded from the bundle with:
NSImage *theImage = [NSImage imageNamed: @"mouse"];
At first I thought the image might not be retained by the cell, but adding a
retain to the image loading made no difference.
I've tried to include all the pertinent code, but may have missed something.
Any help would be appreciated,
John
_______________________________________________
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.