Re: SEL and NSSelectorFromString
Re: SEL and NSSelectorFromString
- Subject: Re: SEL and NSSelectorFromString
- From: Nick Müller <email@hidden>
- Date: Sun, 20 Jan 2002 09:49:18 +0100
On 19.01.2002 at 20:12 Uhr, Jason Blake wrote:
>
I can't find much documentation for what SEL is, or what the format
>
the parameter for NSSelectorFromString takes.
It's all written in the Obj-C-documentation "ObjC.pdf". In most cases,
SEL action = @selector(myAction) will be good enough.
>
In particular I have
>
successfully added menu items to my applications dock menu. however
>
when building up the menuitems for my menu and using the following:
The menu item also requires a target. [item setTarget:self] or alike.
The selector always has one parameter, so your selector should look like
this:
SEL action = @selector(myAction:) // note the colon!
And your action looks like this:
-(void)myAction:(id)sender {
... your code here
}
HTH,
Nick
.........................................
logic tools
WebObjects // Web Authoring // Perl
Nick Mueller // Muenchen // Germany