Re: selectors in NSDictionaries?
Re: selectors in NSDictionaries?
- Subject: Re: selectors in NSDictionaries?
- From: Mike Blaguszewski <email@hidden>
- Date: Thu, 6 Apr 2006 19:49:00 -0400
On Apr 6, 2006, at 7: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?
[...]
[tempDict setObject:@selector(someFunction:) forKey:@"Loader"];
That won't work, because Cocoa data structures like NSDictionary can
only contain objects, and a selector isn't an object. Rather, it's a
pointer (see objc.h), so you'll need to wrap it with +[NSValue
valueWithPointer:].
--
Mike Blaguszewski / Cocoa Hacker / Ambrosia Software, Inc.
_______________________________________________
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