初学iOS开发的同学,不管是自己写的,还是粘贴的代码,或多或少都写过下面的代码[[NSBundlemainBundle]pathForResource:@"someFileName"ofType:@"yourFileExtension"];[YourViewControllerinitWithNib...
分类:
移动开发 时间:
2015-08-04 18:52:25
阅读次数:
163
NSString *path = [[NSBundle mainBundle] pathForResource: @"type" ofType:@"csv"]; NSString* fileContents = [NSString stringW...
分类:
其他好文 时间:
2015-07-26 17:07:08
阅读次数:
128
知识要点 1. xib最终会变成nib文件2. NSBundle实例方法 - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)ext; 如果bundle中不存在某个文件,则返回的path为nil,如果存在 则会返回该文....
分类:
移动开发 时间:
2015-07-09 19:34:00
阅读次数:
1769
1。NSString *path = [[NSBundle mainBundle] pathForResource:@"文件名"ofType:@"plist"];// 文件数据类型是arrayNSArray *array=[NSArray arrayWithContentsOfFile:path];...
分类:
移动开发 时间:
2015-07-08 00:06:48
阅读次数:
162
1.播放短声音 SystemSoundID shake_sound_male_id = 0; NSString *thesoundFilePath = [[NSBundle mainBundle] pathForResource:@"ReceivedMessage" ofType:@"...
分类:
移动开发 时间:
2015-07-06 21:31:19
阅读次数:
129
整理Linq to Objects中运算符延迟计算特性按字母顺序整理:具有延迟计算的运算符Cast,Concat,DefaultIfEmpty,Distinct,Except,GroupBy,GroupJoin,Intersect,Join,OfType,OrderBy,OrderByDescend...
分类:
其他好文 时间:
2015-06-09 13:16:41
阅读次数:
116
原文地址:http://blog.csdn.net/gf771115/article/details/7718403NSError *error;// NSString *path = [[NSBundle mainBundle] pathForResource:@"testxml" ofType....
分类:
移动开发 时间:
2015-06-05 15:44:25
阅读次数:
203
NSString* localPath = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"jpg"]; NSURL* fileUrl = [NSURL fileURLWithPath:localPath]; CIImage* ...
分类:
移动开发 时间:
2015-06-04 13:42:04
阅读次数:
257
1.读取图片NSString *path = [[NSBundle mainBundle] pathForResource"icon" ofType"png"];myImage = [UIImage imageWithContentsOfFile:path]; 2.更改cell选中的背景 UIVie...
分类:
移动开发 时间:
2015-06-02 21:34:29
阅读次数:
145
解析Json数据1 //加载.json文件2 NSString *path = [[NSBundle mainBundle]pathForResource:@"product.json" ofType:nil];3 //根据路径加载json文件到nsdata中4 NSData *data = [NS...
分类:
移动开发 时间:
2015-06-02 15:01:57
阅读次数:
153