home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!iitmax!thsscvc
- From: thsscvc@iitmax.iit.edu (Chris Conley)
- Subject: loading code dynamically with NXBundle
- Message-ID: <1992Dec23.045347.19934@iitmax.iit.edu>
- Keywords: NXBundle classNamed nib loads fine
- Organization: Illinois Institute of Technology / Academic Computing Center
- Date: Wed, 23 Dec 92 04:53:47 GMT
- Lines: 56
-
-
- Greetings little elves, all busy toiling away on MCCA's,
-
- I have a quick question, :) , about dynamically loading classes using
- NXBundle.
-
- The bundle directory from which I would like to load is separate from my
- main bundle. This bundle directory consists of an interface file,
- PositioningMap.nib (inside the English.lproj dir), executable code,
- PositioningMap, and a tiff file. The whole bundle directory is called
- PositioningMap.framework. The executable code is made up of a single class
- called PositioningMap, a view subclass.
-
- I made PositioningMap.m the nib file's owner. Everything compiles fine
- as a bundle in ProjectBuilder.
-
- From my application, I can load the nib file, but for some reason I can't get
- it to load in the PositioingMap view. In the console, it says:
-
- Dec 22 22:02:07 localhost ConceptBoard[3348]: objc: class `PositioningMap'
- not linked into application
-
- Here's a snippet of code:
-
- // The following seems to work fine
- if (myBundle = [[NXBundle alloc] initForDirectory:bundlePath]) {
- printf("Seem to have gotten myBundle OK\n");
- }
-
- // This does not give me the Celebrate message
- classObj = [[[myBundle classNamed:PositioningMap] alloc] initFrame:NULL];
- if (classObj) {
- printf("Celebrate good times, c'mon...\n");
- }
-
- // And the following seems to work
- if ([myBundle getPath:buf forResource:"PositioningMap" ofType:"nib"]) {
-
- loadedNib = [NXApp loadNibFile:buf owner:NXApp withNames:NO
- fromZone:[NXApp zone]];
- }
-
- This is when I get the `PositioningMap' not linked into application message
- on the Console.
-
- Any comments back would be appreciated. This is for a Thesis demonstration.
- If the the question seems trivial, please forgive, I'm a designer, not
- a CS guru...
-
-
- Merry Holidays,
-
- Chris Conley
- Institute of Design, IIT
-
- thsscvc@iitmax.iit.edu
-