[NSBundle mainBundle] 详解
来源:互联网 发布:js 封装自定义组件 编辑:程序博客网 时间:2024/05/23 01:27
我们可以通过包的信息的数据字典 得到 应用的版本 CFBundleVersion = "1.3";
let key ="CFBundleVersion"
// 获得当前软件的版本号
let currentVersion = NSBundle.mainBundle().infoDictionary![key]?.integerValue
// 打印当前软件版本信息
print(NSBundle.mainBundle().infoDictionary)
NSLog(@"ios 应用发布后 .app 应用文件 路径::%@",[NSBundle mainBundle] );
NSLog(@"ios 应用发布后 .app 应用包(文件) 的详细信息 ::%@",[[NSBundle mainBundle] infoDictionary]);
[[NSBundle mainBundle] infoDictionary] 返回的是一个数据字典内容如下:
Optional(["CFBundleExecutable": WBBaiSiDemo, "DTPlatformVersion": 9.2, "UISupportedInterfaceOrientations": (
UIInterfaceOrientationPortrait
), "UILaunchImages": (
{
UILaunchImageMinimumOSVersion = "8.0";
UILaunchImageName = "Brand Assets-800-Portrait-736h";
UILaunchImageOrientation = Portrait;
UILaunchImageSize = "{414, 736}";
},
{
UILaunchImageMinimumOSVersion = "8.0";
UILaunchImageName = "Brand Assets-800-667h";
UILaunchImageOrientation = Portrait;
UILaunchImageSize = "{375, 667}";
},
{
UILaunchImageMinimumOSVersion = "7.0";
UILaunchImageName = "Brand Assets-700";
UILaunchImageOrientation = Portrait;
UILaunchImageSize = "{320, 480}";
},
{
UILaunchImageMinimumOSVersion = "7.0";
UILaunchImageName = "Brand Assets-700-568h";
UILaunchImageOrientation = Portrait;
UILaunchImageSize = "{320, 568}";
}
), "DTSDKName": iphonesimulator9.2, "CFBundleName": WBBaiSiDemo, "DTSDKBuild": 13C75, "CFBundleNumericVersion": 33587200, "CFBundleIdentifier": ---.WBBaiSiDemo, "CFBundleSupportedPlatforms": (
iPhoneSimulator
), "CFBundleSignature": ????, "UIRequiredDeviceCapabilities": (
armv7
), "DTXcode": 0721, "LSRequiresIPhoneOS": 1, "CFBundleInfoPlistURL": Info.plist -- file:///Users/rrd/Library/Developer/CoreSimulator/Devices/0A1EFEF5-85D9-4E24-B122-8E4A478E3FC3/data/Containers/Bundle/Application/3BCA746D-AD65-4152-BCC0-842DBF5393B5/WBBaiSiDemo.app/, "DTCompiler": com.apple.compilers.llvm.clang.1_0, "BuildMachineOSBuild": 14F1605, "CFBundleShortVersionString": 1.0, "CFBundleVersion": 2, "CFBundlePackageType": APPL, "CFBundleInfoDictionaryVersion": 6.0, "NSAppTransportSecurity": {
NSAllowsArbitraryLoads = 1;
}, "DTXcodeBuild": 7C1002, "CFBundleDevelopmentRegion": en, "DTPlatformName": iphonesimulator, "CFBundleIcons": {
CFBundlePrimaryIcon = {
CFBundleIconFiles = (
AppIcon29x29,
AppIcon40x40,
AppIcon57x57,
AppIcon60x60
);
};
}, "DTPlatformBuild": , "MinimumOSVersion": 9.2, "UIDeviceFamily": (
1
)])
- NSBundle、[NSBundle mainBundle] 详解
- [NSBundle mainBundle] 详解
- [NSBundle mainBundle] 详解
- [NSBundle mainBundle] 详解
- NSBundle 的理解和 mainBundle 类方法详解,nsbundlemainbundle
- NSBundle以及mainBundle
- [[NSBundle mainBundle] infoDictionary]
- NSBundle mainBundle
- [[NSBundle mainBundle] infoDictionary]
- [[NSBundle mainBundle] infoDictionary]
- 深入理解 [NSBundle mainBundle]
- NSBundle MainBundle的路径
- [NSBundle mainBundle] infoDictionary
- [NSBundle mainBundle]加载文件用法
- 获取版本号[[NSBundle mainBundle] infoDictionary]
- 获取版本号[[NSBundle mainBundle] infoDictionary]
- IOS开发之 [[NSBundle mainBundle] infoDictionary]
- initWithNibName 和 [[NSBundle mainBundle] loadNibNamed] 的区别
- H264视频编码成MP4文件
- GC
- hdu4552怪盗基德的挑战书&hdu3336Count the string【后缀数组求各前缀重复次数和】
- mac下安装memcached
- 在Unity中使用Lua脚本:语言层和游戏逻辑粘合层处理
- [NSBundle mainBundle] 详解
- LeetCode27RemoveElement--In Java
- C++学习模板篇(静态数据成员与静态成员函数)
- hidesBottomBarWhenPushed的使用
- 处理placeHolder 的图片内容类型
- Spark 读取HDFS存入 HBase(1.0.0 新 API)
- IO多路复用之poll总结
- Android开发-Touch事件分发响应机制
- Java Socket编程 标准范例(多线程)