标签:io ar sp for on 文件 bs cti nbsp
NSBundle
一.获取图片
1. NSString *path = [[NSBundle mainBundle] pathForResource:@"resourceName" ofType:@“resourceType"];
UIImage *image = [[UIImage imageWithContentsOfFile:path];
2. UIImage *image = [UIImage imageNamed:@"imageName"];
二.获取plist文件
NSArray *array =[[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"name"ofType:@"plist"]];
NSDictionary *dict=[array objectAtIndex:index];//将plist文件中的内容转换成字典
标签:io ar sp for on 文件 bs cti nbsp
原文地址:http://www.cnblogs.com/ZhangYuGe/p/4145925.html