NSString *filePath = [[NSBundle mainBundle] pathForResource:@"cinemalist" ofType:@"plist"]; NSMutableDictionary *myDic = [NSMutableDictionary dictio.....
分类:
其他好文 时间:
2015-09-30 16:27:49
阅读次数:
153
1,使用imageWithContentsOfFile:初始化 UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1.png" ofType:nil]]; UI...
分类:
其他好文 时间:
2015-09-25 07:21:03
阅读次数:
354
swift 2.0项目开发总结一(开发常用)一:新特性(版本判断)的实现 1 let versionStr = "CFBundleShortVersionString" 2 let cureentVersion = NSBundle.mainBundle().infoDictionary![...
分类:
移动开发 时间:
2015-09-25 00:10:45
阅读次数:
198
#define NavigationBar_HEIGHT 44#define LOADIMAGE(file,ext) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:file ofType:ext]]//读...
分类:
其他好文 时间:
2015-09-22 16:01:37
阅读次数:
215
bundle是一个目录,其中包含了程序会使用到的资源. 这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in). 对应bundle,cocoa提供了类NSBundle.我们的程序是一个bundle. 在Finder中,一个应用程序看上去和其他文件没有什么区别...
分类:
其他好文 时间:
2015-09-22 14:27:53
阅读次数:
112
视频音频播放添加框架AVFoundation.framework引入#import 一:音乐播放创建音频播放器AVAudioPlayer *_audio//获取本地音乐NSData *audioData=[NSData dataWithContentsOfFile:[[NSBundle mainBu...
分类:
其他好文 时间:
2015-09-21 13:44:54
阅读次数:
236
JSON解析步骤:1.获取json文件路径NSString*path = [[NSBundle mainBundle] pathForResource:@"Teacher"ofType:@"json"];2.读取文件中的dataNSData *data = [NSData dataWithConte...
分类:
移动开发 时间:
2015-09-18 23:13:59
阅读次数:
217
这里以本地资源为例 播放长音乐:#import //url:网络资源路径,也可以把本地资源转化为网络资源路径 //从本地获取一个资源,转化为URL NSURL* url = [[NSBundle mainBundle]URLForResource:@"背景音乐" withExtension:@"ca...
分类:
移动开发 时间:
2015-09-18 11:49:08
阅读次数:
179
NSString * jsonPath=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Contents.json"]; NSString * jsonStr=[[NSString alloc] initW...
分类:
移动开发 时间:
2015-09-17 21:33:40
阅读次数:
147
常用的单例类有: cocoa Touch框架:UIApplication;NSUserDefaults;NSNotification;NSBundle; cocoa框架:NSFileManager;NSWorkspace;NSApplication. The UIApplication class ...
分类:
其他好文 时间:
2015-09-17 17:17:21
阅读次数:
210