Global Variable

NSBundleDidLoadNotification

A notification that lets observers know when classes are dynamically loaded.

Declaration

const NSNotificationName NSBundleDidLoadNotification;

Discussion

When a request is made to a bundle for a class (classNamed: or principalClass), the bundle dynamically loads the executable code file that contains the class implementation and all other class definitions contained in the file. After the module is loaded, the bundle posts the NSBundleDidLoadNotification.

The notification object is the NSBundle instance that dynamically loads classes. The userInfo dictionary contains an NSLoadedClasses key.

In a typical use of this notification, an object might want to enumerate the userInfo array to check if each loaded class conformed to a certain protocol (say, an protocol for a plug-and-play tool set); if a class does conform, the object would create an instance of that class and add the instance to another NSArray object.

See Also

Getting Classes from a Bundle

- classNamed:

Returns the Class object for the specified name.

principalClass

The bundle’s principal class.

NSLoadedClasses

A constant used as a key for the userInfo dictionary of a NSBundleDidLoadNotification notification that corresponds to an array of names of each class that was loaded.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software