Re: class_respondsToSelector() in runtime.h?
Re: class_respondsToSelector() in runtime.h?
- Subject: Re: class_respondsToSelector() in runtime.h?
- From: Laurent Daudelin <email@hidden>
- Date: Wed, 30 Jun 2010 18:02:38 -0400
On Jun 30, 2010, at 17:48, Greg Parker wrote:
> On Jun 30, 2010, at 2:42 PM, Laurent Daudelin wrote:
>> Yes, I know that, but can you send an instance method to a class object?
>
> Yes, you can. Every class object is itself an instance of NSObject. Therefore, every class object also responds to all of NSObject's instance methods.
>
> http://sealiesoftware.com/blog/archive/2009/04/14/objc_explain_Classes_and_metaclasses.html
>
> (Pedantically, every class object is itself an instance of its root class. But to a close approximation that root class is always NSObject.)
>
Thanks, Greg. I guess you learn something new every day. I've never had to check if a class object responded to a selector before but now that's good to know! Going back to my code now...
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/
Logiciels Nemesys Software email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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