• 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: isKindOf: for two Class objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isKindOf: for two Class objects


  • Subject: Re: isKindOf: for two Class objects
  • From: "Clark Cox" <email@hidden>
  • Date: Fri, 7 Sep 2007 13:56:09 -0700

On 9/7/07, Jesse Grosjean <email@hidden> wrote:
> I have two Class objects and I want to see if one of them isKindOf:
> the other. I started off with this code, but the test always fails:
>
>         Class arrayClass1 = [NSArray class];
>         Class arrayClass2 = [NSArray class];
>
>         if ([arrayClass1 isKindOfClass:arrayClass2]) {
>                 NSLog(@"Success");
>         } else {
>                 NSLog(@"Fail");
>         }
>
> I can see why, since Class's must be their own thing, but I still
> can't figure a good way to do my test.

Is this what you're looking for: [arrayClass1 isSubclassOfClass: arrayClass2]?

--
Clark S. Cox III
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

  • Follow-Ups:
    • Re: isKindOf: for two Class objects
      • From: Jesse Grosjean <email@hidden>
References: 
 >isKindOf: for two Class objects (From: Jesse Grosjean <email@hidden>)

  • Prev by Date: Re: RS: NSObject members class and isMemberOfClass
  • Next by Date: Re: isKindOf: for two Class objects
  • Previous by thread: isKindOf: for two Class objects
  • Next by thread: Re: isKindOf: for two Class objects
  • Index(es):
    • Date
    • Thread