Can't set image in NSImageView
Can't set image in NSImageView
- Subject: Can't set image in NSImageView
- From: email@hidden
- Date: Fri, 6 Feb 2004 23:59:50 EST
I have the following routine in my app that exicutes when a button is clicked.
_______________________________________________
- (IBAction)mystart:(id)sender
{
// [statusImage setImage:@"onstate.png"]; // doesn't work
NSString *myImage;
myImage = @"onstate.png";
[statusImage setImage:(NSImage *)myImage];
[actionButton setTitle:@"Stop"];
[actionButton setAction:@selector(mystop:)];
}
_______________________________________________
When the button is clicked, it doesn't change the image and gives the
following errer.
2004-02-06 23:50:05.953 XSKeyEMU[21019] NSImageCell's object value must be an
NSImage.
_______________________________________________
I have looked at the information on NSImageView's "setImage"
setImage:
- (void)setImage:(NSImage *)image
Lets you specify the image the receiver displays.
See Also: - image
_______________________________________________
and it doesn't say much about it, any ideas what the problem is and a
solution?
_______________________________________________
Dale
_______________________________________________
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.