NSString * jsonPath=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Contents.json"]; NSString * jsonStr=[[NSString alloc] initW...
分类:
移动开发 时间:
2015-09-15 16:16:08
阅读次数:
168
UI简单总结:一、常用单例: NSBundle*bundel = [NSBundlemainBundle]; //加载资源 NSFileManager*fm = [NSFileManagerdefaultManager];//文件管理 UIApplication*app = [UIApplicati...
分类:
移动开发 时间:
2015-09-14 21:11:17
阅读次数:
212
从视频中获取截图:NSString *movpath =[[NSBundle mainBundle] pathForResource:@”iosxcode4″ ofType:@”mov”];mpviemController =[[MPMoviePlayerViewController alloc]....
分类:
移动开发 时间:
2015-09-14 18:09:56
阅读次数:
156
页面间传值主要分为:1、属性传值。2、协议传值。3、单例传值;界面之间的传值:1、从前往后:属性传值2、从后往前:代理传值3、多界面之间的传值 — 单例传值单例传值:单例:(1、只有一个对象;2、程序退出时空间才会被回收)[UIScreen mainScreen][NSBundle mainBund...
分类:
其他好文 时间:
2015-09-11 20:54:01
阅读次数:
240
bundle是一个目录,其中包含了程序会使用到的资源.这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in).对应bundle,cocoa提供了类NSBundle.我们现在用bundle获取程序里的一张图片,并显示到View上。新建一个Single View...
分类:
移动开发 时间:
2015-09-11 12:19:06
阅读次数:
185
JSON解析步骤:- (NSArray *)products{ if (_products == nil) {//第一步:获取JSON文件的路径:NSString *path = [[NSBundle mainBundle]pathForResource:@"products.json" ofTyp...
分类:
移动开发 时间:
2015-08-31 21:26:38
阅读次数:
161
导入一个plist文件 里面是一个数组,每一个数组元素是一个字典,字典元素包括 icon 和 tittle-(NSArray *)pic{ if (_pic == nil) { NSString * path = [[NSBundle mainBundle] pathForResource:@"pi...
分类:
其他好文 时间:
2015-08-30 14:08:02
阅读次数:
115
默认情况下播放器自带各种控制按钮,比如前进后退播放暂停等:var url = NSBundle.mainBundle().URLForResource("1", withExtension: "mp4")var play1 = MPMoviePlayerViewController(contentU...
分类:
编程语言 时间:
2015-08-29 18:30:49
阅读次数:
2974
学习NSNotification时遇到了这个问题,错误日志如下:2015-08-28 17:47:24.617 NSNotificationDemo[7158:786614] *** Terminating app due to uncaught exception 'NSInternalIncon...
分类:
其他好文 时间:
2015-08-28 19:42:26
阅读次数:
166
//初始化url NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"abc" ofType:@"mp4"]]; //初始化播放视频 moviePlayer =[[MPMoviePlayerCo.....
分类:
其他好文 时间:
2015-08-27 20:49:58
阅读次数:
133