NSBundle加载xib的cell
来源:互联网 发布:达内大数据培训多少钱 编辑:程序博客网 时间:2024/05/20 18:08
NSBundle 类中,苹果给出的解释是:
An object represents a location in the file system that groups code and resources that can be used in a program. objects locate program resources, dynamically load and unload executable code, and assist in localization. You build a bundle in Xcode using one of these project types: Application, Framework, plug-ins.
NSBundle
NSBundle
大概翻译过来:
NSBundle 对象指代相应应用程序下的所有可用的文件系统。就是说,可以用NSBundle操作应用程序下,所有可用的资源(包括,xib文件,数据文件,图片 等)。
NSBundle 英语中的解释是:“捆,束”的意思,那我们可以理解为:
NSBundle是将程序中所有资源捆在一起的对象。
mainBundle方法:
Returns the NSBundle
+ (NSBundle *)mainBundle
该方法:返回NSBundle 对象;可以用该对象来返回应用程序可操作的路径和文件。
- (NSArray
参数:
name:nib文件的名称
owner:指定name参数所指代的nib文件的File's Owner
options:当nib文件开始时,需要的数据
返回值:返回符合对象的数组。
例子:初始化一个View
CustomCell *cell=(CustomCell *)[tableView dequeueReusableCellWithI
if (cell==nil) {
NSArray *nib=[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:selfoptions:nil];
cell=[nib objectAtIndex:0];// 因为返回的是数组
}
6 0
- NSBundle加载xib的cell
- 重xib加载cell
- iOS 加载xib cell
- xib自定义cell代码怎么加载 代码加载xib的cell
- tableview 用xib加载cell
- tableView 加载cell xib文件
- 加载cell的xib的两种方式
- iOS:从xib文件中加载Cell
- 注册xib自定义的cell
- 加载XIB的方法
- xib的加载
- 关于xib的加载
- xib中多个cell下的Autoresizing问题
- 自定义等高的cell(使用XIB)
- 通过xib自定义cell的说明
- 自定义等高的cell(xib)
- xib自定义非等高的cell
- xib中创建cell的注意事项
- VB.NET机房重构代码集锦—未提供参数
- 聚集索引和非聚集索引详解
- ehcache整合spring注解方式 (亲测OK)
- 19、手机触屏事件
- 多线程学习2
- NSBundle加载xib的cell
- MyISAM和InnoDB区别
- Linux下C语言的内存对齐
- FragmentActivity和FragmentActivity
- javax.crypto.Cipher类--加密和解密
- SNMP的操作命令:Get Set Trap
- Makefile文件的编写
- RobotArt机器人离线编程软件介绍(详细篇)
- Java 的Headless模式