• 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
Re: Can't set image in NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Can't set image in NSImageView (From: email@hidden)
 >Re: Can't set image in NSImageView (From: Steve Bird <email@hidden>)

  • Prev by Date: Re: Can't set image in NSImageView
  • Next by Date: Re: Can't set image in NSImageView
  • Previous by thread: Re: Can't set image in NSImageView
  • Next by thread: Re: Can't set image in NSImageView
  • Index(es):
    • Date
    • Thread