2012-05-31 30 views
0

我試圖加載具有NSBundle對象 的幫助下,包,但這束沒有加載到主束 代碼:無法加載束

NSBundle *bundle= [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"iphone_bundle" ofType:@"bundle"]]; 
     [bundle load]; 
     NSLog(@"%d",[bundle load]); 

包的名稱是iphone_bundle

回答

0

如果我正確地得到了你,我認爲你正在努力尋找你的文件的路徑,嘗試了這種方式: -

NSString *path=[[NSBundle mainBundle] pathForResource:@"iphone_bundle" ofType:@"bundle"]; 

謝謝!

+0

沒有actully因此我設計了一些ontain廈門國際銀行廈門國際銀行的一些捆綁的文件,我想加載在運行時是廈門國際銀行容器包.. ... – DheerajDhiman

+0

哦!好吧,我嘗試找到解決方案。 – TheTiger

+0

http://stackoverflow.com/questions/863321/iphone-how-to-load-a-view-using-a-nib-file-created-with-interface-builder 看到這個 - – TheTiger

0

您可以使用您的包資源,如下圖所示..

[UIImage imageNamed:@"iphone_bundle.bundle/someImage.png"];