Re: How to validate the Undo menu item?
Re: How to validate the Undo menu item?
- Subject: Re: How to validate the Undo menu item?
- From: Matt Neuburg <email@hidden>
- Date: Fri, 9 Aug 2002 07:15:49 -0700
At 8:06 PM -0700 8/8/02, Dustin Voss wrote:
>
On Wednesday, August 7, 2002, at 08:46 PM, Matt Neuburg wrote:
>
>
> On Wed, 7 Aug 2002 16:08:50 -0700, Dustin Voss <email@hidden> said:
>
>
>
>> NSString *sel = NSStringFromSelector([item action]);
>
>> if ([sel isEqualToString:@"undo:"])
>
>> P.S. Is there a better way to check for equality of SELs?
>
>
>
> Are you saying that
>
>
>
> ([item action] == @selector(undo:))
>
>
>
> fails on your machine? m.
>
>
Ah. I wondered if I could use a simple equality test, since SEL is a
>
complex data type, structure unknown
(1) It isn't the type but the uniqueness of selectors that's in play here.
There is only one selector with the name "undo:". Both [item action] and
@selector(undo:) refer to the address of that selector. Since there's only
one, it's the same address. See How_Messaging_Works.html.
(2) To find out if you can use a simple equality test, try it. m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.