获取当前版本、比较线上版本、然后决定是否更新
当前版本:
????//////获取?info.plist文件内容
????NSDictionary?*infoDic?=?[[NSBundle?mainBundle]?infoDictionary];??
????////获取gen...
分类:
移动开发 时间:
2014-10-17 15:47:30
阅读次数:
173
IOS程序中的应用名称和版本号在 info.plist 文件中存储着,要想在程序中获得需要使用 NSBundle 对象下面是示例代码: 1 NSBundle *bundle = [NSBundle mainBundle]; 2 3 NSDictionary *infodict = bundle......
分类:
移动开发 时间:
2014-10-16 14:35:12
阅读次数:
195
由于webview 加载的是网页 只能用js 进行页内查找 废话不说上代码// 注入 JS 查找 NSString *resPath = [[NSBundle mainBundle] resourcePath]; static NSString *jsQuery = nil; st...
分类:
移动开发 时间:
2014-10-10 02:46:33
阅读次数:
339
1利用NSBundle 取得json文件路径NSString *path=[[NSBundle mainBundle]pathForResource:@"help.json" ofType:nil];2把文件转成NSDataNSData *data=[NSData dataWithContentsO...
分类:
Web程序 时间:
2014-10-09 22:16:17
阅读次数:
169
swift 获取app版本号及 ios 版本号 NSBundle.mainBundle().infoDictionary
分类:
移动开发 时间:
2014-10-09 14:24:33
阅读次数:
211
//通过XIB的方式创建视图对象 NSBundle *bundle = [NSBundle mainBundle]; NSArray *array = [bundle loadNibNamed:@"View" owner:self options:nil]; UIView ...
分类:
移动开发 时间:
2014-10-01 23:47:11
阅读次数:
514
1 1.取较大文件,大图 2 NSString *Path = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"plist"]; 3 NSString *str = [NSString stringWithContentsOf...
分类:
其他好文 时间:
2014-09-29 11:18:07
阅读次数:
203
1.UIImage *img = [UIImage imageNamed:@"imageName"];2.NSString *imageFilePath = [[NSBundle mainBundle] pathForResource:@"100" ofType:@"jpg"];NSData *im...
分类:
其他好文 时间:
2014-09-26 19:03:08
阅读次数:
155
可以使用MPMoviePlayerController来播放本地视频文件
1.添加 Mediaplayer framework 并且在viewcontroller中#import
2. 把视频文件拖拽到xcode中
3. 获取文件存放的路径
NSString*thePath=[[NSBundle mainBundle] pathForResource:@"yourVideo" of...
分类:
移动开发 时间:
2014-09-25 22:41:38
阅读次数:
440
1.在Xcode5下,获取程序名字(app name)的方法为:NSString *proName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];NSLog(@"dicName ==== ...
分类:
移动开发 时间:
2014-09-25 17:09:29
阅读次数:
174