• 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: Graham Cox <email@hidden>
  • Date: Thu, 27 Mar 2008 15:43:14 +1100

Thanks, that was it (docs not explicit on this point, saying the file is called "runtime.h" or "/usr/include/objc/runtime.h"). I guess something changed since it was written.


-------

However, having got it compiling, I think it's a blind alley anyway. Maybe if I can explain WHY I'm trying to do this a better solution might pop up ;-)

I have a class that can contain different objects which all derive from a class R. The container can accept instances of any subclass of R.

Each subclass of R implements a CLASS method for a particular feature, returning an array. The container needs to build an array which is the union of all the arrays returned by each subclass. Thus it needs to iterate through a list of all possible subclasses of R, combining the arrays as it goes. Problem is that not all possible subclasses of R are known until runtime, so I need a way to be able to get hold of such a list, based on the fact that they all inherit from R. Note that these are not instances of R, but classes. (I can get a list of instances I have right now, but that doesn't cover the possibility of another object instance derived from R being added after I already built the array).

Hope this makes sense - any ideas?


------ S.O.S.

On 27 Mar 2008, at 3:12 pm, Jerry Krinock wrote:
#import <objc/objc-runtime.h>

_______________________________________________

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

  • Prev by Date: Re: Getting a list of all classes, etc...
  • Next by Date: Re: uncaught breakpoint
  • 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