![](/img/trans.png)
[英]How to reuse an Xcode project into a new project? Static library, Framework, Targets?
[英]How to convert an Xcode project into a static library or framework?
我有一個項目,我需要導入到其他項目作為框架,就像我們如何導入Coredata框架,Quartzcore等...如何實現? 如何將我的項目編譯成可以導入到其他項目的庫或框架? 請解釋一下步驟。
提前致謝。
https://github.com/jverkoey/iOS-Framework嘗試使用此鏈接創建框架和資源包。將項目中使用的圖像,xib和其他資源包裝成bunble並將類復制到Cocoa觸摸靜態庫項目。
如果你想編譯像UIKit.framework這樣的“標准”框架,試試這個Universal Framework iPhone iOS
其他
替換從主bundle加載資源的所有代碼,以從TestPluginBundle加載資源。 也許你想為UIImage添加一個類別因為你想使用imageNamed:
所以你可以使用[UIImage testPluginImageNamed:@"small.png"]
。 在項目中替換很容易並添加相關的頭文件。 以.xib文件為例:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { //self = [super initWithNibName:nibNameOrNil bundle:[NSBundle mainBundle]]; // you need to define a method to get the bundle 'TestPluginBundle.bundle', here I used '[TestPlugin TestPluginBundle]' self = [super initWithNibName:nibNameOrNil bundle:[TestPlugin TestPluginBundle]]; ... }
之后,將.a文件和.bundle文件添加到另一個項目中。 在另一個項目中,您需要再次添加相關框架。
我已經成功地將這種方法用於我的工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.