一点静态库的知识

来源:互联网 发布:浙大恩特软件 编辑:程序博客网 时间:2024/06/05 05:34

在终端上输入命令:

cd  改变文件夹

pwd 显示当前路径
ls  显示当前文件夹中的所有文件的子文件夹
lipo -info [文件名称] :显示静态库文件的架构类型
iphone用lipo合并模拟器库和真机库,发布一个通用的静态库
lipo -create [文件名称1,文件名称2,.......,文件名称n] -output  ./ [生成的文件名称]

//静态库中是不能包含资源文件的!!!(图片,xib,音频等)
需要资源文件的时候,生成file.bundle。
NSString *libraryBundlePath = [[NSBundle mainBundle] pathForResource:@“file” ofType:@"bundle"];
NSString *path = [libraryBundlePath stringByAppendingPathComponent:@"1.png"];

-(UIImage*) imagesNamedFromCustomBundle:(NSString *)name  
{  
    NSString *main_images_dir_path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"nono.bundle/images"];  
//    NSAssert(main_images_dir_path, @"main_images_dir_path is null");  
    NSString *image_path = [main_images_dir_path stringByAppendingPathComponent:name];  
    return [UIImage imageWithContentsOfFile:image_path];  
}  


在静态库中可以做什么::
1. 定义基础的数据类
2.定义视图类
3.定义视图控制器类
0 0
原创粉丝点击