码迷,mamicode.com
首页 >  
搜索关键字:nsbundle    ( 385个结果
plist文件的读取
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"cinemalist" ofType:@"plist"]; NSMutableDictionary *myDic = [NSMutableDictionary dictio.....
分类:其他好文   时间:2015-09-30 16:27:49    阅读次数:153
UIImage的几种初始化方式以及在UIImageView中内容模式的设置
1,使用imageWithContentsOfFile:初始化 UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1.png" ofType:nil]]; UI...
分类:其他好文   时间:2015-09-25 07:21:03    阅读次数:354
iOS开发——项目实战Swift篇&swift 2.0项目开发总结一(开发常用)
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
NSBundle详解
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
ios之json,xml解析
JSON解析步骤:1.获取json文件路径NSString*path = [[NSBundle mainBundle] pathForResource:@"Teacher"ofType:@"json"];2.读取文件中的dataNSData *data = [NSData dataWithConte...
分类:移动开发   时间:2015-09-18 23:13:59    阅读次数:217
[IOS:OC]简单音频播放
这里以本地资源为例 播放长音乐:#import //url:网络资源路径,也可以把本地资源转化为网络资源路径 //从本地获取一个资源,转化为URL NSURL* url = [[NSBundle mainBundle]URLForResource:@"背景音乐" withExtension:@"ca...
分类:移动开发   时间:2015-09-18 11:49:08    阅读次数:179
JSON TO NSDictionary Mac & iOS
NSString * jsonPath=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Contents.json"]; NSString * jsonStr=[[NSString alloc] initW...
分类:移动开发   时间:2015-09-17 21:33:40    阅读次数:147
单例设计模式逐步讲解003
常用的单例类有: cocoa Touch框架:UIApplication;NSUserDefaults;NSNotification;NSBundle; cocoa框架:NSFileManager;NSWorkspace;NSApplication. The UIApplication class ...
分类:其他好文   时间:2015-09-17 17:17:21    阅读次数:210
385条   上一页 1 ... 15 16 17 18 19 ... 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!