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

Re: SEL's and parameters?


  • Subject: Re: SEL's and parameters?
  • From: Ondra Cada <email@hidden>
  • Date: Sun, 17 Nov 2002 01:29:18 +0100

On Sunday, November 17, 2002, at 12:27 , Tim Dorr wrote:

[[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...

I am quite unsure whether I follow you or not, but it *seems* to me you actually want to do something like

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

-(void)doURL:sender {
id url=[sender representedObject];
...
}
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.

References: 
 >SEL's and parameters? (From: Tim Dorr <email@hidden>)

  • Prev by Date: Re: Some realities
  • Next by Date: Re: SEL's and parameters?
  • Previous by thread: SEL's and parameters?
  • Next by thread: Re: SEL's and parameters?
  • Index(es):
    • Date
    • Thread