• 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: selectors in NSDictionaries?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: selectors in NSDictionaries?


  • Subject: Re: selectors in NSDictionaries?
  • From: Ricky Sharp <email@hidden>
  • Date: Thu, 6 Apr 2006 18:54:41 -0500


On Apr 6, 2006, at 6:37 PM, Azza wrote:

do you know if it is possible to save a selector reference i.e
@selector(someFunction:) inside a NSDictionary like this?

    NSMutableDictionary * tempDict;
    tempDict = [[ NSMutableDictionary alloc ] init];
    [tempDict setObject:@"Work" forKey:@"Display"];
    [tempDict setObject:[[NSArray alloc] init] forKey:@"Data"];
    [tempDict setObject:self forKey:@"Object"];
    [tempDict setObject:@selector(someFunction:) forKey:@"Loader"];

Not sure what that will do. Perhaps it would be better to store the selector name instead:


NSString* theSelectorName = NSStringFromSelector (@selector (someFunction:));

To get it back...

SEL theSelector = NSSelectorFromString(theSelectorName);

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Fwd: selectors in NSDictionaries? (From: Azza <email@hidden>)

  • Prev by Date: Re: FYI: NSKeyedArchiver success
  • Next by Date: Re: selectors in NSDictionaries?
  • Previous by thread: Re: selectors in NSDictionaries?
  • Next by thread: Re: selectors in NSDictionaries?
  • Index(es):
    • Date
    • Thread