• 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
NSImage cell tanking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSImage cell tanking (and slow NSTableView)
      • From: John Timmer <email@hidden>
References: 
 >Re: NSImage method problem (From: David Remahl <email@hidden>)

  • Prev by Date: [Q] How do I Create an NSEvent Using Runtime Functions?
  • Next by Date: Re: Future Objective-C changes
  • Previous by thread: Re: NSImage method problem
  • Next by thread: Re: NSImage cell tanking (and slow NSTableView)
  • Index(es):
    • Date
    • Thread