• 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: Testing an NSImageView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing an NSImageView?


  • Subject: Re: Testing an NSImageView?
  • From: Albert Atkinson <email@hidden>
  • Date: Sun, 1 Sep 2002 18:12:44 -0500

I loaded the image using the code:

[well1 setImage: [NSImage imageNamed: @"Off.tiff"]];

Does this help any?

Let me know if you can think of any ideas of what I am doing wrong or what I could do differently.

Thanks! =)

Albert

On Sunday, September 1, 2002, at 05:49 PM, Scott Anguish wrote:

On Sunday, September 1, 2002, at 06:17 PM, Albert Atkinson wrote:

Greetings!

How would I go about testing an NSImageView to see if it contains a
certain image? I have tried the following two lines of code:

if ([[well1 image] isEqualTo: @"Off"])


The first shouldn't work because you're comparing an NSImage to an NSString..

> and

if ([[[well1 image] name] isEqualToString: @"Off"])


name will only work if the NSImage was assigned the name using setName:, or loaded using imageNamed:

How are you loading it?

You might be better off keeping the instance elsewhere to compare against..
_______________________________________________
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.

  • Follow-Ups:
    • Re: Testing an NSImageView?
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Testing an NSImageView? (From: Scott Anguish <email@hidden>)

  • Prev by Date: IB Crash: Amendment
  • Next by Date: Re: Selecting NSTextFieldCell as First Responder?
  • Previous by thread: Re: Testing an NSImageView?
  • Next by thread: Re: Testing an NSImageView?
  • Index(es):
    • Date
    • Thread