A bit stumped....
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)