iOS中NSBundle类An NSBundle object represents a location in the file system that groups code and resources that can be used in a program. NSBundle object...
分类:
其他好文 时间:
2015-12-29 14:26:01
阅读次数:
552
一:UIWebView加载数据的方式有三种: 1:- (void)loadRequest:(NSURLRequest*)request NSString * path = [[NSBundle mainBundle] pathForResource:@"demoFolder" ofType:...
分类:
编程语言 时间:
2015-12-25 21:06:23
阅读次数:
398
IOS加载音频文件 需要导入#import 1 NSString *path = [[NSBundle mainBundle] pathForResource:@"胭脂泪" ofType:@"mp3"]; //把音频文件转换成url格式 2 3 NSURL *urlStr ...
分类:
移动开发 时间:
2015-12-25 19:00:25
阅读次数:
400
[UIImage imageNamed:ImageName];1、加载图片占据的内存较大2、相同的图片只会加载一份到内存中,如果同时使用,使用同一个对象即可3、当对象销毁,图片对象不会随着一起销毁NSString *path = [[NSBundle mainBundle] pathForResou...
分类:
其他好文 时间:
2015-12-23 21:12:19
阅读次数:
278
主要原因如下:+ (instancetype)mineHeaderView{ return [[NSBundle mainBundle] loadNibNamed:@"DDMineHeaderView" owner:nil options:nil].lastObject;}添加手势后, 以上的...
分类:
其他好文 时间:
2015-12-22 16:08:09
阅读次数:
484
一、数据来源1.来源于mainBundle2.来源于服务器二、解析步骤`1.数据来源于mainBundle//读取数据 NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"test.json" ofType:nil];解析数据(...
分类:
Web程序 时间:
2015-12-18 00:05:57
阅读次数:
310
NSBundle、NSArray、NSDictionay读取plist文件NSDictionary*dict= [NSDictionarydictionaryWithContentsOfFile:[[NSBundlemainBundle]pathForResource:@"fileName"ofTy...
分类:
其他好文 时间:
2015-12-17 23:56:01
阅读次数:
156
ios开发中会用到plist保存数据,读取plist数据只需要一行代码就行:NSArray * appInfos = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"appslist" ofType:...
分类:
移动开发 时间:
2015-12-07 00:24:04
阅读次数:
156
使用bundle加载xib,代码如下: UIView *appInfoView = [[[NSBundle mainBundle] loadNibNamed:@"xibName" owner:nil options:nil] lastObject]; [self.view addSubview:ap...
分类:
移动开发 时间:
2015-12-06 12:52:19
阅读次数:
1129
xib文件的实质是xml,描述界面对象,每个对象都有一个很重要的属性,identity inspector面板中class属性,加载xib文件的时候实际上是实例化界面对象相对应的这些class。xib文件的加载过程: 1.将xib文件从磁盘载入内存,有两种技术可以加载xib文件:NSBundle和U...
分类:
移动开发 时间:
2015-12-05 19:16:47
阅读次数:
195