打包静态库 .a .framework
2019-07-19 本文已影响0人
寂寞先森666
************************* .a 静态库 ****************************
第一、制造静态库.a 文件


#import <Foundation/Foundation.h>
@interface showMessage : NSObject
+(void)show;
@end
#import "showMessage.h"
@implementation showMessage
+(void)show
{
NSLog(@"hello world");
}
@end
运行之后


第二步、把静态库.a 拉入到工程中使用

#import "Debug-iphonesimulator/include/showMessage/showMessage.h"
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
[showMessage show];
}
2019-07-19 16:26:26.710072+0800 测试iqKey[55545:4411576] hello world
2019-07-19 16:26:26.945118+0800 测试iqKey[55545:4411576] hello world
2019-07-19 16:26:27.114899+0800 测试iqKey[55545:4411576] hello world
注意、用模拟器打包的.a 只能用于模拟器运行,用真机打包的.a 只能用于真机运行
shoubindeMacBook-Pro:~ shoubintao$ cd 目录下
shoubindeMacBook-Pro:Debug-iphonesimulator shoubintao$ lipo -info libshowMessage.a
Non-fat file: libshowMessage.a is architecture: x86_64
************************* .framework 静态库 ****************************



