Re: Can't set image in NSImageView
Re: Can't set image in NSImageView
- Subject: Re: Can't set image in NSImageView
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 6 Feb 2004 21:15:44 -0800
On Feb 6, 2004, at 8:59 PM, email@hidden wrote:
2004-02-06 23:50:05.953 XSKeyEMU[21019] NSImageCell's object value
must be an
NSImage.
Umm, read the error message. It tells you that the object you're
passing isn't an image...
I have looked at the information on NSImageView's "setImage"
setImage:
- (void)setImage:(NSImage *)image
Lets you specify the image the receiver displays. [...]
and it doesn't say much about it, any ideas what the problem is and a
solution?
It tells you as much as you need -- the object you set must be an
NSImage.
NSString *myImage;
myImage = @"onstate.png";
[statusImage setImage:(NSImage *)myImage];
Why do you think that casting something that you originally defined and
created as an NSString might transform it into an NSImage? I suggest
reviewing the basic documentation for Objective-C
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaObjects/index.html>, and looking elsewhere in the documentation
for NSImage for other ways of creating an image object.
mmalc
_______________________________________________
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.