1.NSBundle1> 一个NSBundle代表一个文件夹,利用NSBundle能访问对应的文件夹2> 利用mainBundle就可以访问软件资源包中的任何资源3> 案例: // File : 全路径 // NSBundle : 一个NSBundle代表一个文件夹 ...
分类:
其他好文 时间:
2015-03-05 23:44:21
阅读次数:
140
转载▼ iOS获取应用程序信息NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];其中的信息示范:版本号:[infoDictionary objectForKey:@"CFBundleVersion"];应用程序...
分类:
移动开发 时间:
2015-03-04 18:24:25
阅读次数:
162
//获取全局的Delegate对象,这样我们可以调用这个对象里的方法和变量 [[UIApplication sharedApplication] delegate]; //获得程序的主Bundle NSBundle *bundle = [NSBundle mainBundle]; /* 在...
分类:
移动开发 时间:
2015-03-02 09:26:14
阅读次数:
151
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNilviewDidLoadviewWillAppearviewWillDisapppear《iOS编程》P137关于视图的初...
分类:
移动开发 时间:
2015-02-24 23:20:59
阅读次数:
171
错误信息:reason: 'Could not load NIB in bundle: 'NSBundle
(loaded)' with name 'collectViewCell''
查找原因:UICollectionView注册的是时候出错;
如下:
[self.collectionView registerNib:[UINib nibWithNibName:@"sch...
分类:
其他好文 时间:
2015-02-14 16:18:40
阅读次数:
834
//加载gif 02 03 NSString *filePath = [[NSBundle mainBundle]pathForResource:@"bai3" ofType:@"gif"]; 04 05 NSData *data = [NSData da...
分类:
其他好文 时间:
2015-02-13 19:50:48
阅读次数:
187
//软件版本
- (void)softwareVersion
{
NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
NSString *currentVersion = [NSString stringWithFormat:@"当前软件版本为:%@",infoDic[@"CFBundleShortVers...
分类:
移动开发 时间:
2015-02-09 20:21:32
阅读次数:
148
---恢复内容开始---1. 读取文件 (本地 UTF-8编码的文本文件) NSString *filePath = [[NSBundle mainBundle] pathForResource:@"song" ofType:@"json"]; NSString *str =[NSString s....
分类:
移动开发 时间:
2015-02-07 18:47:21
阅读次数:
153
1.File’s Owner为nil UIView *demo1 = [[[NSBundle mainBundle] loadNibNamed:@"demo1" owner:nil options:nil] lastObject]; CGRect rect = demo1.frame; rec...
分类:
移动开发 时间:
2015-02-03 20:59:18
阅读次数:
565
NSString * key = (__bridge NSString *) kCFBundleVersionKey; /// 当前软件的版本号 NSString * currentVersion = [NSBundle mainBundle].infoDictionary[key]; ...
分类:
其他好文 时间:
2015-02-03 18:50:21
阅读次数:
155