• 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: Monitoring class loading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitoring class loading


  • Subject: Re: Monitoring class loading
  • From: Kyle Moffett <email@hidden>
  • Date: Sun, 18 Aug 2002 18:18:46 -0400

On Sunday, August 18, 2002, at 08:50 AM, Ondra Cada wrote:
On Sunday, August 18, 2002, at 01:31 , Kyle Moffett wrote:

I am looking to write a tool that needs to know about the existence
of every single class that gets loaded, and I am stumped. I looked
for something in the ObjC runtime that would let me register a
handler, and I looked for a method that gets called to do perclass
initialization, but I was unable to find anything. Is there a way to
do this, or am I out of luck?

Check NSBundle. NSBundleDidLoadNotification/NSLoadedClasses might be somewhat interesting to you. Also, NSObject-level +load is somewhat related, but I bet the former is actually what you want.

Yes, that will help. Unfortunately, I also need a list of already loaded classes.
I am writing a Perl <-> Objective-C library to allow Objective-C objects to be
used from Perl. I know somebody at Apple has such a thing, but it does not
automatically attempt to generate interfaces for classes it does not know about.
I want to be able to write code that binds the message calling system and a few
basic data types (Not objects), and then be able to generate Perl objects
automatically to bind to the ObjC objects.

Wait!!! I just figured it out. The user doesn't need to be able to get a list of every
class that is loaded, it merely needs to let the user say:
use MacOSX::NS OutlineView Document;
and have it load NSOutlineView and NSDocument under MacOSX::NS::OutlineView
and MacOSX::NS::Document.

The NSClassFromString(NSString *aClassName) method should allow me to get the
needed Class object for the given classname, and then I can use and AUTOLOAD
function to properly send ObjC messages.

Yay!!! It will work!!! Yay!!! (Sorry if I'm a bit overenthusiastic :-)

Thanks anyway,
Kyle Moffett
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Monitoring class loading
      • From: Sherm Pendley <email@hidden>
References: 
 >Re: Monitoring class loading (From: Ondra Cada <email@hidden>)

  • Prev by Date: Getting machine's host id
  • Next by Date: Re: Bookmarks a la OmniWeb!
  • Previous by thread: Re: Monitoring class loading
  • Next by thread: Re: Monitoring class loading
  • Index(es):
    • Date
    • Thread