ios-製作靜態.a檔案

來源:互聯網
上載者:User

標籤:users   hone   show   developer   測試   library   uicolor   str   frame   

一、製作靜態庫檔案

/*靜態庫製作*///  MakeA.h-(NSString*)testA;//  MakeA.m-(NSString*)testA{        return @"靜態庫測試成功";}//  TestVC.h@property (nonatomic,strong) UILabel * label;@property (nonatomic,copy) NSString * Title;//  TestVC.m-(NSString*)Title{        if (!_Title) {        _Title = [[NSString alloc]init];    }    return _Title;}-(UILabel*)label{        if (!_label) {        _label = [[UILabel alloc]initWithFrame:CGRectMake(100, 200, 50, 50)];        _label.backgroundColor = [UIColor cyanColor];            }    return _label;}

二、配置靜態庫檔案

 

三、運行項目,產生靜態庫

1、用模擬器運行一次;

2、用真機運行一次;

四、靜態庫完成

libaMakeA.a   ----->show in finder

五、將模擬器和真機的.a 合并

終端:wangyalu:~ wangyalu$ lipo -create /Users/wangyalu/Library/Developer/Xcode/DerivedData/MakeA-flvyjcsvqkctmsbtnlbnrzeeksen/Build/Products/Debug-iphoneos/libMakeA.a  /Users/wangyalu/Library/Developer/Xcode/DerivedData/MakeA-flvyjcsvqkctmsbtnlbnrzeeksen/Build/Products/Debug-iphonesimulator/libMakeA.a  -output /Users/wangyalu/Desktop/libMakeA.a


六、使用製作成的靜態庫


 

ios-製作靜態.a檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.