• 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
CFBundleRef for a dylib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFBundleRef for a dylib?


  • Subject: CFBundleRef for a dylib?
  • From: Alfred Van Hoek <email@hidden>
  • Date: Mon, 17 Oct 2005 11:12:50 -0400

What are the requirements to obtain a CFBundleRef for a dylib?

The following code:

#if TARGET_RT_MAC_MACHO

Boolean _LoadFrameWorkBundle(FSRef framework, CFBundleRef *dylib)
{
	CFURLRef		bundleURL = NULL;
	CFBundleRef		myBundle;

OSErr err = coreFoundationUnknownErr;

bundleURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &framework);

if (bundleURL == nil) {
err = coreFoundationUnknownErr;
}


if (err == noErr) {
myBundle = CFBundleCreate(kCFAllocatorSystemDefault, bundleURL);
if (myBundle == nil) {
err = coreFoundationUnknownErr;
}
}

if ( myBundle != NULL ) {
Boolean ok = CFBundleLoadExecutable( myBundle ); // Try to load the executable from my bundle.
}
// Clean up.

if (bundleURL != nil) {
CFRelease(bundleURL);
}
*dylib = myBundle;
return (err == noErr);
}
#endif


will work for QuickTime.plugin or other packages, but not if the FSRef represents a .dylib. The dylib is not a package, the bundleURL contains the name "myLib.dylib".

What's the correct protocol?

Alfred

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


  • Follow-Ups:
    • Re: CFBundleRef for a dylib?
      • From: Chris Espinosa <email@hidden>
  • Prev by Date: Re: Debugging Objective-C++ - how to? SOLVED
  • Next by Date: Re: Speeding up XCode?
  • Previous by thread: Re: Having Image PICT NIB problem ?
  • Next by thread: Re: CFBundleRef for a dylib?
  • Index(es):
    • Date
    • Thread