Re: Can't set image in NSImageView
Re: Can't set image in NSImageView
- Subject: Re: Can't set image in NSImageView
- From: m <email@hidden>
- Date: Fri, 6 Feb 2004 21:56:57 -0800
How about something concrete and helpful, as opposed to elliptical and
self-righteous?
To wit: replace
[statusImage setImage:(NSImage *)myImage];
with
[statusImage setImage:[NSImage imageNamed:@"onstate.png"]];
And do read and (understand) quite ample documentation.
_murat
On Feb 6, 2004, at 9:23 PM, Steve Bird wrote:
On Feb 6, 2004, at 11:59 PM, email@hidden wrote:
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
// because it wants an image, not a string
NSString *myImage;
myImage = @"onstate.png";
// Despite calling it an image, it's a string
[statusImage setImage:(NSImage *)myImage];
--- coercing a string pointer to an image pointer doesn't make a
string into an image.
--- just giving the file name is not enough. You have to give it an
NSImage.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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.
_______________________________________________
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.