iOS 获取app的版本号

 

 // - app 的 Bundle versions string, short

[[NSBundlemainBundle]objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]

 

 

 

 // - app 的 build

 NSString *key =@"CFBundleVersion";

 NSString *currentVersion = [NSBundlemainBundle].infoDictionary[key];

 

 

 

App默认是有开启了多任务功能,而多任务功能是需要App支持所有方向,如果我们App是有需要支持多任务,则需要开启App对各个方向(上、下、左、右)的支持;如果App不需要开启多任务,则只需要将如下示意图的 requires full screen 勾选

Hidden starus bar  用来启动app的时候隐藏状态栏!

 

 

NSLog(@"%@", [NSBundle mainBundle].infoDictionary);

打印结果如下 :

        2016-07-05 18:08:17.757 DYCode[9224:216214] {
    BuildMachineOSBuild = 15E65;
    CFBundleDevelopmentRegion = en;
    CFBundleExecutable = DYCode;
    CFBundleIdentifier = "com.QG.DYCode";
    CFBundleInfoDictionaryVersion = "6.0";
    CFBundleInfoPlistURL = "Info.plist -- file:///Users/lichaoqun/Library/Developer/CoreSimulator/Devices/0DDD96CE-6C7F-4730-8B8A-F7D20BAAE87D/data/Containers/Bundle/Application/EDC6CF98-434C-4820-89E6-8B921F5289B5/DYCode.app/";
    CFBundleName = DYCode;
    CFBundleNumericVersion = 16809984;
    CFBundlePackageType = APPL;
    CFBundleShortVersionString = "1.0";
    CFBundleSignature = "????";
    CFBundleSupportedPlatforms =     (
        iPhoneSimulator
    );
    CFBundleVersion = 1;
    DTCompiler = "com.apple.compilers.llvm.clang.1_0";
    DTPlatformBuild = "";
    DTPlatformName = iphonesimulator;
    DTPlatformVersion = "9.3";
    DTSDKBuild = 13E230;
    DTSDKName = "iphonesimulator9.3";
    DTXcode = 0731;
    DTXcodeBuild = 7D1014;
    LSRequiresIPhoneOS = 1;
    MinimumOSVersion = "8.2";
    NSAppTransportSecurity =     {
        NSAllowsArbitraryLoads = 1;
    };
    UIDeviceFamily =     (
        1,
        2
    );
    UILaunchStoryboardName = LaunchScreen;
    UIMainStoryboardFile = Main;
    UIRequiredDeviceCapabilities =     (
        armv7
    );
    UISupportedInterfaceOrientations =     (
        UIInterfaceOrientationPortrait,
        UIInterfaceOrientationLandscapeLeft,
        UIInterfaceOrientationLandscapeRight
    );
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值