标签: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
六、使用制作成的静态库
标签:users hone show developer 测试 library uicolor str frame
原文地址:http://www.cnblogs.com/sayimba/p/6273793.html