How to set menu action with argument.
How to set menu action with argument.
- Subject: How to set menu action with argument.
- From: Youngjin Kim <email@hidden>
- Date: Thu, 5 Jul 2001 12:14:51 +0900
Let's say this method will display a picture with given id.
-(void)selectPicture:(int)picID{
...
}
and I want the picture by selecting menu which has to be build in
runtime. I tried something like this.
// make a menu item and set action & target.
...
[newItem setTarget:self];
[newItem setAction:@selector(selectPicture:)];
Obviously, this code doesn't work because it doesn't specify image id.
How can I set this menu item's action to call selector _with_
argument(s)?
Youngjin