home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / next / programm / 7889 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.2 KB  |  67 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!iitmax!thsscvc
  3. From: thsscvc@iitmax.iit.edu (Chris Conley)
  4. Subject: loading code dynamically with NXBundle
  5. Message-ID: <1992Dec23.045347.19934@iitmax.iit.edu>
  6. Keywords: NXBundle classNamed nib loads fine
  7. Organization: Illinois Institute of Technology / Academic Computing Center
  8. Date: Wed, 23 Dec 92 04:53:47 GMT
  9. Lines: 56
  10.  
  11.  
  12. Greetings little elves, all busy toiling away on MCCA's,
  13.  
  14. I have a quick question,  :) , about dynamically loading classes using
  15. NXBundle.
  16.  
  17. The bundle directory from which I would like to load is separate from my
  18. main bundle.  This bundle directory consists of an interface file, 
  19. PositioningMap.nib (inside the English.lproj dir), executable code, 
  20. PositioningMap, and a tiff file.  The whole bundle directory is called
  21. PositioningMap.framework.  The executable code is made up of a single class
  22. called PositioningMap, a view subclass.
  23.  
  24. I made PositioningMap.m the nib file's owner.  Everything compiles fine
  25. as a bundle in ProjectBuilder.
  26.  
  27. From my application, I can load the nib file, but for some reason I can't get
  28. it to load in the PositioingMap view.  In the console, it says:
  29.  
  30. Dec 22 22:02:07 localhost ConceptBoard[3348]: objc: class `PositioningMap' 
  31. not linked into application
  32.  
  33. Here's a snippet of code:
  34.  
  35. // The following seems to work fine
  36. if (myBundle = [[NXBundle alloc] initForDirectory:bundlePath]) {
  37.     printf("Seem to have gotten myBundle OK\n");
  38. }
  39.     
  40. // This does not give me the Celebrate message     
  41. classObj = [[[myBundle classNamed:PositioningMap] alloc] initFrame:NULL];
  42.         if (classObj) {
  43.             printf("Celebrate good times, c'mon...\n");
  44.         }
  45.  
  46. // And the following seems to work
  47. if ([myBundle getPath:buf forResource:"PositioningMap" ofType:"nib"]) {
  48.         
  49.     loadedNib = [NXApp loadNibFile:buf owner:NXApp withNames:NO 
  50.                 fromZone:[NXApp zone]];
  51.     }
  52.  
  53. This is when I get the `PositioningMap' not linked into application message
  54. on the Console.
  55.  
  56. Any comments back would be appreciated.  This is for a Thesis demonstration.
  57. If the the question seems trivial, please forgive, I'm a designer, not
  58. a CS guru...
  59.  
  60.  
  61. Merry Holidays,
  62.  
  63. Chris Conley
  64. Institute of Design, IIT
  65.  
  66. thsscvc@iitmax.iit.edu
  67.