• 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: Michael Ash <email@hidden>
  • Date: Thu, 1 Jul 2010 12:05:53 -0400

On Wed, Jun 30, 2010 at 5:44 PM, Dave Carrigan <email@hidden> wrote:
>
> On Jun 30, 2010, at 2:35 PM, Laurent Daudelin wrote:
>
>> Well, isn't -respondsToSelector: an instance method?
>
>
> if ([[Someclass class] respondsToSelector:@selector(classSelector)]) {
>        // yup
> }

An extremely minor nitpick: the use of +class here is necessary. You
can simply write [Someclass respondsToSelector:...]. The use of
[Someclass class] is only necessary when you want to use Someclass as
a value or parameter or such.

Mike
_______________________________________________

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

  • Follow-Ups:
    • Re: class_respondsToSelector() in runtime.h?
      • From: Michael Ash <email@hidden>
    • Re: class_respondsToSelector() in runtime.h?
      • From: Dave DeLong <email@hidden>
  • Prev by Date: Re: Capturing output from another task with elevated privilages
  • Next by Date: Re: class_respondsToSelector() in runtime.h?
  • Previous by thread: Re: class_respondsToSelector() in runtime.h?
  • Next by thread: Re: class_respondsToSelector() in runtime.h?
  • Index(es):
    • Date
    • Thread