美文网首页
静态库和framework的封装

静态库和framework的封装

作者: liboxiang | 来源:发表于2019-02-20 09:45 被阅读4次

http://www.cocoachina.com/bbs/read.php?tid-282490-page-1.html

注意点:

  • bundle里面不要带plist文件.build setting -> packaging->info.plist file设置为空。否则提审的时候可能会报Executable file相关的错误
  • bundle中资源的获取方法
+(NSBundle*)getResourcesBundle
{
    return  [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JYSDK_IMAGE" ofType:@"bundle"]];
}

+ (NSBundle *)getNibBundle
{
    return  [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"JYSDK_XIB" ofType:@"bundle"]];
}

+ (UIImage *)imageWithName:(NSString *)imageName
{
    NSBundle *bundle = [self getResourcesBundle];
    return [UIImage imageWithContentsOfFile:[bundle pathForResource:imageName ofType:@"png"]];
}

+ (UIView *)loadNibViewWithName:(NSString *)nibName owner:(nullable id)owner
{
    NSBundle *bundle = [self getNibBundle];
    return [bundle loadNibNamed:nibName owner:owner options:nil].lastObject;
}

相关文章

  • IOS动态库和静态库的区别

    framework 是什么 framework 是对静态库和动态库的一个封装(包括了静态库和动态库) 加载方式静态...

  • 封装.a静态库

    封装.framework库 目录__封装静态库基础知识_____1. 新建静态库项目_____2.添加头文件___...

  • 静态库和动态库

    静态库和动态库的存在形式静态库:.a 和 .framework动态库:.dylib 和 .framework 静态...

  • 静态库和动态库

    静态库:.a 和 .framework动态库:.tbd(.dylib) 和 .framework静态库:链接时会...

  • 目录一、库二、静态库、动态库、Framework三、打包静态库 1、.a静态库和.framework静态库的区别 ...

  • 自定义三方SDK静态库、.framework

    静态库和动态库的存在形式 静态库: .a 和 .framework动态库: .dylib 和 .framework...

  • iOS-SDK从无到有

    A、关于静态库和动态库 静态库:.a和.framework ,动态库:.dylib和.framework。.fra...

  • 学习笔试--静态库和动态库

    静态库和动态库的存在形式 静态库:.a和.framework 动态库:.dylib和.framework 创建自己...

  • iOS - 从头开始封装.framework

    前边写了如何封装.a,现在我们就来说说怎么封装.framework相信大家都知道,.framework既是静态库的...

  • iOS里的动态库和静态库

    介绍 动态库形式:.dylib和.framework 静态库形式:.a和.framework 动态库和静态库的区别...

网友评论

      本文标题:静态库和framework的封装

      本文链接:https://www.haomeiwen.com/subject/gnyhkftx.html