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

Re: Objective-C question


  • Subject: Re: Objective-C question
  • From: Randall Meadows <email@hidden>
  • Date: Tue, 10 Feb 2009 10:32:44 -0700

On Feb 10, 2009, at 10:16 AM, Andy Bettis wrote:

I have an id object that I'd like to test to see if it's a certain class or a subclass of that class. isKindOfClass gives a very specific test, is there an easy way to test for an object being a subclass of a class?

That's exactly what -isKindOfClass: gives you. From the docs:

"Returns a Boolean value that indicates whether the receiver is an instance of given class or an instance of any class that inherits from that class."

Notice the last phrase. Also note the warning that the docs give about using this on a class cluster.

-isMemberOfClass: is what you initially describe.
_______________________________________________

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: 
 >Objective-C question (From: Andy Bettis <email@hidden>)

  • Prev by Date: Re: Objective-C question
  • Next by Date: Re: Objective-C question
  • Previous by thread: Re: Objective-C question
  • Next by thread: Folder watching
  • Index(es):
    • Date
    • Thread