• 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: isKindOfClass:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isKindOfClass:


  • Subject: Re: isKindOfClass:
  • From: Michael Ash <email@hidden>
  • Date: Sat, 8 May 2010 18:55:49 -0400

On Sat, May 8, 2010 at 5:14 PM, Sherm Pendley <email@hidden> wrote:
> On Sat, May 8, 2010 at 3:51 PM, Kevin Callahan <email@hidden> wrote:
>> isKindOfClass: is an instance method and doesn't work on a class you get from NSClassFromString().
>
> Because NSObject is a root class (i.e. it has no superclass), you
> *can* send its -isKindOfClass: message to a Class object. Instance
> methods that belong to a root class are special that way.

You can send it, but it probably doesn't do what you want. E.g.
[NSString isKindOfClass:[NSString class]] will return NO, because the
NSString class object is not an instance of NSString. I'd say this
probably qualifies as "doesn't work", even though it doesn't crash or
anything.

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

References: 
 >isKindOfClass: (From: Kevin Callahan <email@hidden>)
 >Re: isKindOfClass: (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: isKindOfClass:
  • Next by Date: Re: Ticker Style Scrolling Text
  • Previous by thread: Re: isKindOfClass:
  • Next by thread: Why I can't change the view's layer anchorPoint?
  • Index(es):
    • Date
    • Thread