码迷,mamicode.com
首页 >  
搜索关键字:pathforresource    ( 126个结果
XML解析(简单)
获取解析文件路径NSString*xmlPath=[[NSBundlemainBundle]pathForResource:@"Citys"ofType:@"xml"];2.初始化xml字符串NSString*xmlStr=[NSStringstringWithContentsOfFile:xmlPathencoding:NSUTF8StringEncodingerror:nil];3.初始化一个GDataXMLDocument对象,因为解析时所有的..
分类:其他好文   时间:2014-09-15 03:23:08    阅读次数:132
AppleScript in Cocoa
NSString *path = [[NSBundle mainBundle] pathForResource:@"××××" ofType:@"scpt"];NSAppleScript *script = [[NSAppleScript alloc] initWithContentsOfURL:[...
分类:移动开发   时间:2014-09-05 17:51:51    阅读次数:225
从plist文件中读取数据
//从plist文件中读取数据-(void)readDataFromPlist{//1.先获取文件路径NSString*filePath=[[NSBundlemainBundle]pathForResource:@"Book"ofType:@"plist"];//2.根据路径初始化字典对象self.dic=[NSMutableDictionarydictionaryWithContentsOfFile:filePath];//将不可边字典变成..
分类:其他好文   时间:2014-09-05 03:25:11    阅读次数:155
展示动态图片(播放一组图片)
//展示动态图片(播放一组图片)//创建做动画的图片,存储到数组中NSMutableArray*animationImages=[NSMutableArrayarray];for(inti=0;i<7;i++){UIImage*p_w_picpath1=[UIImagep_w_picpathWithContentsOfFile:[[NSBundlemainBundle]pathForResource:[NSStringstringWithFormat:..
分类:其他好文   时间:2014-09-05 03:22:11    阅读次数:170
NSBuddle mainBuddle
一.获取图片1. NSString *path = [[NSBuddle mainBuddle] pathForResource:@"resourceName" oftype@"resourceType"]; UIImage *image = [[UIImageimageWithContent...
分类:其他好文   时间:2014-08-31 13:06:31    阅读次数:175
iOS开发-播放本地音频(可后台播放)
//初始化音乐 //创建音乐文件路径 NSString *musicFilePath = [[NSBundle mainBundle] pathForResource:@"eyeExe" ofType:@"mp3"]; //判断文件是否存在 if ([[NSFileManager defaultManager] fileExistsAtPath:music...
分类:移动开发   时间:2014-08-23 01:08:19    阅读次数:313
[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"] 找不到对应的文件解决方法
最近在使用[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]时,找不到其对应的文件,文件当时是通过 右键->add files to 的方式添加到工程里面的,但是使用[[NSBundle mainBundle] pathFor...
分类:其他好文   时间:2014-07-26 00:01:46    阅读次数:455
iOS使用CoreImage处理图像40中可用的滤镜名称
NSString* localPath = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"jpg"]; NSURL* fileUrl = [NSURL fileURLWithPath:localPath]; CIImage* image = [CIImage imageWithContentsOfURL:fileUrl];...
分类:移动开发   时间:2014-07-18 16:31:23    阅读次数:408
音频处理
1. 背景音乐1> 添加AVFoundation.framework框架,import该框架头文件2> 加载背景音乐路径 NSString *path = [[NSBundle mainBundle] pathForResource:@”music.mp3” ofType:nil];3> 路径转化....
分类:其他好文   时间:2014-07-16 18:42:21    阅读次数:220
加载图片时的2种方法
1,仅加载图片,图像数据不会缓存。NSString *path = [[NSBundle mainBundle] pathForResource:@”icon” ofType:@”png”]; UIImage *image = [UIImage imageWithContentsOfFile:pa....
分类:其他好文   时间:2014-06-28 11:43:47    阅读次数:177
126条   上一页 1 ... 10 11 12 13 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!