1,创建bundle
1.png2,命名bundle
2.png3,添加相关的资源
3.png4,5,6 修改 bundle 的相关设置,必须要
4.png5.png
6.png
7,将 framework 和 bundle 联系起来
7.png8,真机编译生成相应的文件
8.png9,工程引用的方法
9.png注意:
引用图片的写法:
[tmpCancelBtn setBackgroundImage:[UIImage imageNamed:@"SToolsFrameworkBundle.bundle/line"] forState:UIControlStateNormal];
引用 xib的方法:
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"bundle名" ofType:@"bundle"]];
return [super initWithNibName:NSStringFromClass([self class]) bundle:bundle];
网友评论