home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!zrz.tu-berlin.de!opal.cs.tu-berlin.de!mauriti
- From: mauriti@cs.tu-berlin.de (Frank Hartlep)
- Subject: Re: Loading classes at run-time: How?
- Message-ID: <1F2618@mailgzrz.tu-berlin.de>
- Sender: news@mailgzrz.tu-berlin.de (News Manager)
- Nntp-Posting-Host: cachalot.cs.tu-berlin.de
- Organization: Technical University of Berlin, Germany
- References: <TA168WJ@mailgzrz.tu-berlin.de>
- Date: Tue, 15 Sep 1992 13:47:23 GMT
- Lines: 19
-
- In article <TA168WJ@mailgzrz.tu-berlin.de>, mauriti@cs.tu-berlin.de (Frank Hartlep) writes:
- > I do not want to use the objc_{load,unload}Module routines because
- > of their FIFO behaviour. Just loading the class file with rld isn't
- > enough, my app still complains 'class MyClass not linked into application'.
- > I can only guess why it reacts like that: There's a hash table containing
- > the Class structures of all classes known to the app, and by trying
- > objc_getClass ("MyClass") I get the same error message. So I suppose I
- > have to insert MyClass into the table by hand. This can be done with
- > objc_addClass (). The only problem is that I can't find any way to
- > obtain the Class structure of MyClass, which I need as an argument for
- > objc_addClass (). Any ideas from where to get this little beast?
-
- Found the solution yesterday:
- getsectdatafromheader (MyMachHeader, "__OBJC", "__class", &Size) returns
- a pointer to an array of Class structs defining the loaded classes.
- If somebody's interested in example code showing how to load/unload
- classes in a random order, I'll post it.
-
- Frank
-