iOSの静的ライブラリa和framework&&リポジトリ.bundle

3308 ワード

一、iOS内の静的ライブラリ形式
.a   .framework
   .framework    ,       .framework    。

二、a与.frameworkの違いは何ですか?
.a         ,.framework                 。
.a        ,    .h    ,.framework        。
.a + .h + sourceFile = .framework。
   .framework。

三、なぜ静的ライブラリを使うのか
1.      ,      。
2.  iOS      。               。
3.          ,              。
4.     sdk   。

四、どのように梱包しますか.a
1.       
  iOS --> Framework & Library --> Cocoa Touch Static Library
2.                
3.     .h  。
  Build Phases --> Copy Files   .h    。
4.       
  4.1             Build Settings --> Build Active Architecture Only --> Debug    NO
  4.2           
5.  
         ,      。
     .a           。
6.     
    :            ,         。

五、どのように梱包しますか.framework
1.  Framework  
  iOS --> Framework & Library --> Cocoa Touch Framework 
2.     framework         
  framework        。
       :Build Settings --> Mach-O Type -->    Static Library
2.                
3.       
       ,           。
  Build Phases --> Headers --> public      
4.  
         ,      
5.  
   framework    。
            General --> Embedded Binaries      。
               。

六、静的ライブラリの問題
1.     
  Debug               Debug-iphoneos   
  Debug                Debug-iphonesimulator   
  Release               Release-iphoneos   
  Release                Release-iphonesimulator   
2.Debug   VS Release  
    2.1   
                       ,      
                      
    2.2   
                       
                        
                        
               ,        ,            
3.Undefind symbols for architecture arm64(i386)
    :       cpu arm64(i386)  
4.iPhone   cpu  
     
    iPhone4s,5   i386  
    iPhone5s    x86_64  
    
    iphone1 ,3G,3GS   armv6  
    iPhone4,4s   armv7  
    iphone5,5s,5c    armv7s  
    iPhone6,6s,6plus,6splus   arm64  
5.  .a         
  lipo -info xxx.a
6..a     
  lipo -create      .a        .a  -output    .a 
  (        ,         )
     Debug          Release    。
7.  .framework         
  7.1   framework    
  7.2 lipo -info Framework    

七、静的ライブラリのコンパイルエラー
1.MRC   :      autorelease,release,retain   
      :     MRC         MRC  
2.       
         ,  :Build Settings -->   Header Search Paths -->    $(SDK_DIR)/usr/include/libxml2
3.framework  ,          
     test-framework is not a valid PROJECT_NAME

八、依存ライブラリエラー
1._SCNetWork  
    SystemConfiguration.framework
2._UITypeCopy   + _kUITag  
    MobileCoreServices.framework
3._defalate   + _inflate  
     libz.tbd
4._xml  
    libxml2.tbd

九、静的ライブラリの導入運転エラー
1.    
             ,        Build Settings --> Other Linker Flags -->   -ObjC

十、資源静的ライブラリbundle
1.       
2.   (  ,plist...)      
3.        bundle    。
4.      
          ,              bundle          。
       :[UIImage imageNamed:@"xxx.bundle/xxx"];

十一、テスト可能な静的ライブラリを作成する
1.      
2.          Target
3.     
4.       
General --> Linked Frameworks and Libraries -->      .a
5.     --         .