Type Method

bundleForClass:

Returns the NSBundle object with which the specified class is associated.

Declaration

+ (NSBundle *)bundleForClass:(Class)aClass;

Parameters

aClass

A class.

Return Value

The NSBundle object that dynamically loaded aClass (a loadable bundle), the NSBundle object for the framework in which aClass is defined, or the main bundle object if aClass was not dynamically loaded or is not defined in a framework.

This method creates and returns a new NSBundle object if there is no existing bundle associated with aClass. Otherwise, the existing instance is returned.

See Also

Creating and Initializing a Bundle

bundleWithURL:

Returns an NSBundle object that corresponds to the specified file URL.

bundleWithPath:

Returns an NSBundle object that corresponds to the specified directory.

bundleWithIdentifier:

Returns the NSBundle instance that has the specified bundle identifier.

initWithURL:

Returns an NSBundle object initialized to correspond to the specified file URL.

initWithPath:

Returns an NSBundle object initialized to correspond to the specified directory.