• 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
SEL's and parameters?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SEL's and parameters?


  • Subject: SEL's and parameters?
  • From: Tim Dorr <email@hidden>
  • Date: Sat, 16 Nov 2002 18:27:16 -0500

Ok, I'm new to Cocoa and still a bit confused on how selectors wrok with regards to parameters.

What I'm trying to do is create an NSStatusBar element with a series of dynamically created menu items. What I want to be able to do is define the action of the menu items to call a function that loads a URL passed into it. Here's what I had assumed was the right idea:

[[theMenu addItemWithTitle:[dictionary objectForKey:@"title"]
action:@selector(doURL: [dictionary objectForKey:@"url"])
keyEquivalent:@""]
setTarget:self];

Well, that's not right :) So, how would I go about getting the URL for each item into the function, short of creating 100's of function for each menu item...

Thanks,
-Tim
_______________________________________________
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.

  • Follow-Ups:
    • Re: SEL's and parameters?
      • From: Andreas Mayer <email@hidden>
    • Re: SEL's and parameters?
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Jobs
  • Next by Date: Re: TZO Email System?
  • Previous by thread: full keyboard control simulation?
  • Next by thread: Re: SEL's and parameters?
  • Index(es):
    • Date
    • Thread