首先贴一下问题代码 1 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 2 if (self = [super initWithNibName:nibNameOrNil b...
分类:
其他好文 时间:
2015-08-27 17:59:35
阅读次数:
221
NSBundle介绍:它是一个单例类,用来加载资源(2011-09-22 17:51:37)转载▼标签:杂谈分类:iOSbundle是一个目录,其中包含了程序会使用到的资源. 这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in). 对应bundle,coc...
分类:
其他好文 时间:
2015-08-27 12:52:18
阅读次数:
140
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"config_region" ofType:@"csv"]; NSString *text = [NSString stringWithContentsOfFile:fil.....
分类:
移动开发 时间:
2015-08-25 19:07:16
阅读次数:
897
AVAudioPlayer播放一个mp3文件时,居然没有声音。mp3文件是放在工程里面的,路径没有错误但就是死活没有声音。func playSound() { let notifyUrl = NSBundle.mainBundle().pathForResource("notify",...
分类:
其他好文 时间:
2015-08-20 01:12:07
阅读次数:
317
data 加载plist[NSBundle mainBundle][arr writeToURL: atomically:]
分类:
编程语言 时间:
2015-08-19 23:28:53
阅读次数:
167
文件系统总结包系统就是app程序本身,其实是个zip包,资源/可执行文件 都在里面+ (NSBundle *)mainBundle得到程序本身的bundle类. NSBundle提供了很多path相关函数运行期只读,不可写没有必要建立子文件夹,苹果不推荐在包中建立子文件夹+ (UIImage *)i...
分类:
移动开发 时间:
2015-08-18 21:05:25
阅读次数:
190
swift: varoneStoreboard:UIStoryboard=UIStoryboard(name:"view",bundle:NSBundle.mainBundle()); letviewController:UIViewController=oneStoreboar...
分类:
其他好文 时间:
2015-08-18 18:48:18
阅读次数:
83
1、获取全局的Delegate对象,这样我们可以调用这个对象里的方法和变量: [(MyAppDelegate*)[[UIApplicationsharedApplication]delegate]MyMethodOrMyVariable];2、获得程序的主Bundle: NSBundle*bundl...
分类:
移动开发 时间:
2015-08-18 09:01:32
阅读次数:
136
json解析对本地文件解析NSString *path =[[NSBundle mainBundle] pathForResource:@“movielist” ofType:@“txt”];// 第二个参数,制定一个容器来接收解析后的数据NSMutableDictionary *dic =[NSJSONSerialization JSONObjectWithData:data option:NSJ...
分类:
Web程序 时间:
2015-08-17 23:52:45
阅读次数:
363
bundle是一个目录,其中包含了程序会使用到的资源.这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in).对应bundle,cocoa提供了类NSBundle.我们现在用bundle获取程序里的一张图片,并显示到View上。新建一个Single View...
分类:
移动开发 时间:
2015-08-17 11:43:51
阅读次数:
141