• 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: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 10 Feb 2009 19:10:53 +0100


Le 10 févr. 09 à 18:33, I. Savant a écrit :

On Tue, Feb 10, 2009 at 12:26 PM, Mike Abdullah
<email@hidden> wrote:
Read the documentation on -isKindOfClass: again. It does exactly what you
want. -isMemberOfClass: performs the more specific test of excluding
subclasses.

In addition, a common gotcha (for me, anyway - it still gets me now and again) is that you need to remember you're comparing "instances" to "classes" with this method:

([value isKindOfClass:[NSString class]])

 ... not ...

([[value class] isKindOfClass:[NSString class]])

 The former is correct, the latter is what I sometimes find myself
doing (and of course it fails).

Just for the record, you can also compare class, but not with the isKindOfClass: method.


The method below is similar too ([value isKindOfClass:[NSString class]])

[[value class] isSubclassOfClass:[NSString class]]


_______________________________________________

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: Objective-C question
      • From: "I. Savant" <email@hidden>
References: 
 >Objective-C question (From: Andy Bettis <email@hidden>)
 >Re: Objective-C question (From: Mike Abdullah <email@hidden>)
 >Re: Objective-C question (From: "I. Savant" <email@hidden>)

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