Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
re: CFBundleGetMainBundle in an iTunes plugin?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: CFBundleGetMainBundle in an iTunes plugin?

On Fri, 7 May 2004 22:43:03 +0100, Jonathan del Strother
<email@hidden> wrote:
> I'm writing a Carbon iTunes plugin. I'm trying to use a Cocoa bundle
> for the configuration dialog.
> CFBundleCreate is always returning NULL, despite the URL apparently
> being constructed OK. (The URL is
> "Contents/Frameworks/CocoaBundle.bundle" - it's not supposed to be an
> absolute path, is it?)

First off you need to determine where you're starting from. Is the
"Contents/Frameworks/CocoaBundle.bundle" located relative to ITunes, your
plug-in or somewhere else?

If the is a location relative to ITunes then GetMainBundle will return
iTunes bundle. If it's relative to your plug-in the you'll need to determine
your plug-in's bundles. I recommend using CFBundleGetBundleWithIdentifier.
Your plug-in should have an unique identifier; something like
"", etc. Look for the CFBundleIdentifier
property in your plug-in's bundle's info.plist.

So once you have the right bundle you'll pass it to
CFBundleCopyPrivateFrameworksURL to get its "Contents/Frameworks/" folder's
CFURL. Append the "CocoaBundle.bundle" name & extension using

Now you have an absolute path that you can pass to CFBundleCreate.

George Warner,
Schizophrenic Optimization Scientists
Apple Developer Technical Support (DTS)
carbon-development mailing list | email@hidden
Do not post admin requests to the list. They will be ignored.

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.