• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Loading Cocoa Bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading Cocoa Bundles


  • Subject: Re: Loading Cocoa Bundles
  • From: Chaz McGarvey <email@hidden>
  • Date: Sun, 27 Feb 2005 10:24:17 -0700


On Feb 27, 2005, at 6:08 AM, M. Uli Kusterer wrote:

At 10:39 Uhr -0700 25.02.2005, Chaz McGarvey wrote:
I am trying to dynamically load a bundle (for a plugin architecture) using NSBundle, but it fails to load. Here is the loading code I'm using:

// load plugin
		if ( !bundle ) {
			NSLog( @"no bundle.." );
		}
		if ( ![bundle load] ) {
			NSLog( @"bundle didn't load" );
		}
		_pluginClass = [bundle principalClass];
		// now instantiate, etc.
// end

It *might* help if you showed us how "bundle" is actually created, you know...?


Nobody's here to steal your code (at least not if it's that pointless :-p), so don't be afraid and paste some more.


I'm obviously not afraid of stolen code as my code is free and open source. I just thought it would be pointless to list the steps it takes to create a loadable bundle (it doesn't take any code) because they're so trivial, but if you want them...

1. Choose "New Project" from the File menu.
2. Under "Loadable bundle" choose "Cocoa bundle."
3. Create a Cocoa class.
4. When created, select the target and choose "Get Info" from the File menu.
5. In the "Properties" tag, set a unique identifier and enter the created class as the "Principal Class."
6. Compile.



Anyway, I "solved" this issue. I turns out I didn't do anything wrong. I just created another bundle project using these same steps, and this time it actually is loadable. No clue why the first didn't load.


Thanks anyway.....
chaz

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Loading Cocoa Bundles
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >Loading Cocoa Bundles (From: Chaz McGarvey <email@hidden>)
 >Re: Loading Cocoa Bundles (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Re: Objective-C runtime questions
  • Next by Date: NSevent handling in panther
  • Previous by thread: Re: Loading Cocoa Bundles
  • Next by thread: Re: Loading Cocoa Bundles
  • Index(es):
    • Date
    • Thread