Re: Can't set image in NSImageView
Re: Can't set image in NSImageView
- Subject: Re: Can't set image in NSImageView
- From: lbland <email@hidden>
- Date: Sat, 7 Feb 2004 10:12:03 -0500
On Feb 7, 2004, at 9:36 AM, M. Uli Kusterer wrote:
// [statusImage setImage:@"onstate.png"]; // doesn't work
NSString *myImage;
myImage = @"onstate.png";
[statusImage setImage:(NSImage *)myImage];
Seeing you try this, I think assigning an image to an object isn't
really your problem. Your problem is that you need to learn Objective
C first. Without that knowledge, there's not much point in trying to
typecast your way around.
try something like this:
NSString *myImageName = @"onstate.png";
NSImage *myImage = [NSImage imageNamed: myImageName];
[statusImage setImage:myImage];
See the description of "imageNamed" in the NSImage docs.
-lance
_______________________________________________
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.