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

isKindOf: for two Class objects


  • Subject: isKindOf: for two Class objects
  • From: Jesse Grosjean <email@hidden>
  • Date: Fri, 7 Sep 2007 16:28:29 -0400

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. It seems that I need a method like instancesRespondToSelector:, except I need instancesAreKindOfClass:.

Any ideas?

Thanks,
Jesse
_______________________________________________

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: "Clark Cox" <email@hidden>
  • Prev by Date: Re: RS: NSObject members class and isMemberOfClass
  • Next by Date: Re: RS: NSObject members class and isMemberOfClass
  • Previous by thread: Using the tab key to cycle through custom NSViews?
  • Next by thread: Re: isKindOf: for two Class objects
  • Index(es):
    • Date
    • Thread