Re: Passing a SEL into KVC
Re: Passing a SEL into KVC
- Subject: Re: Passing a SEL into KVC
- From: Ryan Britton <email@hidden>
- Date: Wed, 6 Dec 2006 11:34:59 -0800
I will generally wrap it in an NSValue instance when needing to store
it in something that uses objects only.
+ (NSValue *)value:(const void *)value withObjCType:(const char *)type
SEL someSelector = @selector(someMethod:);
NSValue *selectorValue = [NSValue value:&someSelector
withObjCType:@encode(SEL)];
On Dec 6, 2006, at 10:14 AM, Marcus S. Zarra wrote:
Is there any way to pass a SEL into kvc?
For example:
SEL test = @selector(someMethod:);
[self setValue:test forKey:@"selectorTest"];
Marcus S. Zarra
Zarra Studios LLC
Simply Elegant Software for OS X
www.zarrastudios.com_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden