Tekkaman

导航

 

bundle之principal class

   In particular, every Cocoa loadable bundle contains a principal class. The code loading mechanism provided by the NSBundle class uses a bundle’s principal class as an entry point. Applications loading bundles can ask NSBundle to find the principal class and use the returned Class object to create an instance of that class.

NSBundle finds the principal class in one of two ways. First, it looks for the NSPrincipalClass key in the bundle’s information property list. If the key is present, it uses the class named by the key’s value as the bundle’s principal class. If the key is not present or the key specifies a class that does not exist, NSBundle uses the first class loaded as the principal class. If the bundle is built with Xcode, the order of classes as viewed in the project determines the order in which they are loaded.

posted on 2013-04-23 17:39  Tekkaman  阅读(816)  评论(0编辑  收藏  举报