Re: Something I don't understand...
Re: Something I don't understand...
- Subject: Re: Something I don't understand...
- From: rsharp <email@hidden>
- Date: Tue, 8 May 2001 09:27:14 -0500 (CDT)
On Tue, 8 May 2001, Matt Ridley wrote:
>
One of the items does indeed have the label "Sample", but when I
>
click it I never get the beep. The method is definitely firing,
>
and I can get the label of the item (when I NSLog it, it shows
>
up as "Sample", just as I'd expect). Is there something very
>
basic I'm not understanding about how to compare the two strings?
>
>
- (void)toolbaritemclicked:(NSToolbarItem*)item {
>
if ([item label] == @"Sample")
>
NSBeep();
>
}
What happens if you use the compare method of NSString rather than
operator == ?
I know that in Java, == will actually do an object equivalency test rather
than an object's contents equivalency test.
Of course, I may be completely wrong...I've only been doing Obj-C for 2
days now.
Rick Sharp
Instant Interactive(tm)