• 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: class_respondsToSelector() in runtime.h?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >class_respondsToSelector() in runtime.h? (From: Laurent Daudelin <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Greg Parker <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Laurent Daudelin <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Kyle Sluder <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Laurent Daudelin <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Greg Parker <email@hidden>)

  • Prev by Date: NSString ambiguities
  • Next by Date: Re: NSString ambiguities
  • Previous by thread: Re: class_respondsToSelector() in runtime.h?
  • Next by thread: Re: class_respondsToSelector() in runtime.h?
  • Index(es):
    • Date
    • Thread