• 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
A bit stumped....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A bit stumped....


  • Subject: A bit stumped....
  • From: email@hidden
  • Date: Fri, 20 Jul 2001 10:49:15 -0400

Hey all, I'm hoping someone can figure this one out.

I've set up an NSPopupButton in IB. It has three menu items - Read, Write, and Delete.

In PB, I'm using if statements to try to get which item is selected. I've set up one string to be [rwdMenu titleOfSelectedItem] and three other strings that are just set to Read, Write, and Delete. But the if statements won't work! Using NSLog, I can see that the rwdString is either Read, Write, or Delete, depending on which item is selected, but if I do this:

if ( rwdString == readString )
NSLog (@"It's equal to Read");
else if ( rwdString == writeString )
NSLog (@"It's equal to Write");
else if ( rwdString == deleteString )
NSLog (@"It's equal to Delete");
else
NSLog (@"It's not equal to any of those, it's \"%@\"", rwdString);

It ALWAYS tells me it's not equal to any of the strings, though with the last NSLog entry, I see either Read, Write, or Delete. What gives? Is the titleOfSelectedItem in some other encoding than the other strings? Or will this just not work (I hope that's not the answer, it would make things difficult!)?

Thanks for any help,

Mike (aka Darkshadow)


  • Follow-Ups:
    • Use of NSLog() for debugging
      • From: Art Isbell <email@hidden>
    • Re: A bit stumped....
      • From: Jeff Binder <email@hidden>
    • Re: A bit stumped....
      • From: "David P. Henderson" <email@hidden>
  • Prev by Date: Re: NSToolBar Implementation
  • Next by Date: Re: NSToolBar Implementation
  • Previous by thread: Re: Resize corner on NSPanel
  • Next by thread: Re: A bit stumped....
  • Index(es):
    • Date
    • Thread