Getting the Main Bundle

suggest change
  1. Getting a reference to the main bundle using Cocoa.

To get the main bundle in a Cocoa application, call the mainBundle class method of NSBundle.

NSBundle *mainBundle;
// Get the main bundle for the app
mainBundle = [NSBundle mainBundle];
  1. Getting a reference to the main bundle using Core Foundation.

Use CFBundleGetMainBundle to retrieve the main bundle for a C-based application. Do not release the bundle it returns.

CFBundleRef mainBundle;
// Get the main bundle for the app
mainBundle = CFBundleGetMainBundle();

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents