获取解析文件路径NSString*xmlPath=[[NSBundlemainBundle]pathForResource:@"Citys"ofType:@"xml"];2.初始化xml字符串NSString*xmlStr=[NSStringstringWithContentsOfFile:xmlPathencoding:NSUTF8StringEncodingerror:nil];3.初始化一个GDataXMLDocument对象,因为解析时所有的..
分类:
其他好文 时间:
2014-09-15 03:23:08
阅读次数:
132
NSString *path = [[NSBundle mainBundle] pathForResource:@"××××" ofType:@"scpt"];NSAppleScript *script = [[NSAppleScript alloc] initWithContentsOfURL:[...
分类:
移动开发 时间:
2014-09-05 17:51:51
阅读次数:
225
//从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
一.获取图片1. NSString *path = [[NSBuddle mainBuddle] pathForResource:@"resourceName" oftype@"resourceType"]; UIImage *image = [[UIImageimageWithContent...
分类:
其他好文 时间:
2014-08-31 13:06:31
阅读次数:
175
//初始化音乐
//创建音乐文件路径
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"]时,找不到其对应的文件,文件当时是通过 右键->add files to 的方式添加到工程里面的,但是使用[[NSBundle mainBundle] pathFor...
分类:
其他好文 时间:
2014-07-26 00:01:46
阅读次数:
455
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
1,仅加载图片,图像数据不会缓存。NSString *path = [[NSBundle mainBundle] pathForResource:@”icon” ofType:@”png”]; UIImage *image = [UIImage imageWithContentsOfFile:pa....
分类:
其他好文 时间:
2014-06-28 11:43:47
阅读次数:
177