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                                      
laur...@nemesys-soft.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to