Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在NSBundle对象的帮助下加载一个包,但这个包没有加载到主包代码中:
NSBundle
NSBundle *bundle= [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"iphone_bundle" ofType:@"bundle"]]; [bundle load]; NSLog(@"%d",[bundle load]);
捆绑包的名称是iphone_bundle
iphone_bundle
您可以使用捆绑包中的资源,如下所示。
[UIImage imageNamed:@"iphone_bundle.bundle/someImage.png"];