home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6164 < prev    next >
Encoding:
Text File  |  1992-09-15  |  1.6 KB  |  32 lines

  1. Newsgroups: comp.sys.next.programmer
  2. 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
  3. From: mauriti@cs.tu-berlin.de (Frank Hartlep)
  4. Subject: Re: Loading classes at run-time: How?
  5. Message-ID: <1F2618@mailgzrz.tu-berlin.de>
  6. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  7. Nntp-Posting-Host: cachalot.cs.tu-berlin.de
  8. Organization: Technical University of Berlin, Germany
  9. References:  <TA168WJ@mailgzrz.tu-berlin.de>
  10. Date: Tue, 15 Sep 1992 13:47:23 GMT
  11. Lines: 19
  12.  
  13. In article <TA168WJ@mailgzrz.tu-berlin.de>, mauriti@cs.tu-berlin.de (Frank Hartlep) writes:
  14. > I do not want to use the objc_{load,unload}Module routines because
  15. > of their FIFO behaviour. Just loading the class file with rld isn't
  16. > enough, my app still complains 'class MyClass not linked into application'.
  17. > I can only guess why it reacts like that: There's a hash table containing
  18. > the Class structures of all classes known to the app, and by trying
  19. > objc_getClass ("MyClass") I get the same error message. So I suppose I
  20. > have to insert MyClass into the table by hand. This can be done with
  21. > objc_addClass (). The only problem is that I can't find any way to
  22. > obtain the Class structure of MyClass, which I need as an argument for
  23. > objc_addClass (). Any ideas from where to get this little beast?
  24.  
  25. Found the solution yesterday:
  26. getsectdatafromheader (MyMachHeader, "__OBJC", "__class", &Size) returns
  27. a pointer to an array of Class structs defining the loaded classes.
  28. If somebody's interested in example code showing how to load/unload
  29. classes in a random order, I'll post it.
  30.  
  31. Frank
  32.