• 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: Getting a list of all classes, etc...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting a list of all classes, etc...


  • Subject: Re: Getting a list of all classes, etc...
  • From: Chris Suter <email@hidden>
  • Date: Thu, 27 Mar 2008 17:59:40 +1100


On 27/03/2008, at 4:59 PM, Graham Cox wrote:

This worked well (after a little tweaking!) thanks - got the whole caboodle running now. I note that NSObject's superclass is NULL, so I had to switch the order of the while() test in order to correctly detect plain NSObjects (admittedly this will probably never be needed in practice).

Here's my implementation (including objective C 2.0 variant), for anyone's further use:
[snip]

You could probably implement classIsSubclassOfClass as:

BOOL classIsSubclassOfClass (const Class aClass, const Class subclass)
{
  return class_getClassMethod (aClass, @selector (isSubclassOfClass:))
    ? [aClass isSubclassOfClass:subclass] : NO;
}

- Chris

_______________________________________________

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: Getting a list of all classes, etc...
      • From: Graham Cox <email@hidden>
References: 
 >Getting a list of all classes, etc... (From: Graham Cox <email@hidden>)
 >Re: Getting a list of all classes, etc... (From: "Sherm Pendley" <email@hidden>)
 >Re: Getting a list of all classes, etc... (From: Graham Cox <email@hidden>)
 >Re: Getting a list of all classes, etc... (From: Graham Cox <email@hidden>)
 >Re: Getting a list of all classes, etc... (From: "Sherm Pendley" <email@hidden>)
 >Re: Getting a list of all classes, etc... (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Core Data/IB questions
  • Next by Date: Re: Writing a preference pane that configures hotkeys?
  • Previous by thread: Re: Getting a list of all classes, etc...
  • Next by thread: Re: Getting a list of all classes, etc...
  • Index(es):
    • Date
    • Thread