• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to set menu action with argument.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to set menu action with argument.
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: AppKit source available as reference?
  • Next by Date: converting application to cocoa
  • Previous by thread: Capturing Keys
  • Next by thread: Re: How to set menu action with argument.
  • Index(es):
    • Date
    • Thread