🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1055

Re: Loading classes at run-time: How?

#1055
From: Frank Hartlep
Date: Tue, 15 Sep 1992 13:47
19 lines
1656 bytes
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
Technical Details
Message-ID: <1F2618@mailgzrz.tu-berlin.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!zrz.tu-berlin.de!opal.cs.tu-berlin.de!mauriti
References: <TA168WJ@mailgzrz.tu-berlin.de>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!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