zoukankan      html  css  js  c++  java
  • app版本新特性

    代码实例:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        
        NSString *key = @"CFBundleVersion";
        
        // 取出沙盒中存储的上次使用软件的版本号
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        NSString *lastVersion = [defaults stringForKey:key];
        
        // 获得当前软件的版本号
        NSString *currentVersion = [NSBundle mainBundle].infoDictionary[key];
        
        if ([currentVersion isEqualToString:lastVersion]) {
            // 显示状态栏
            application.statusBarHidden = NO;
            
            self.window.rootViewController = [[cctvTabBarViewController alloc] init];
        } else { // 新版本
            self.window.rootViewController = [[cctvNewfeatureViewController alloc] init];
            // 存储新版本
            [defaults setObject:currentVersion forKey:key];
            [defaults synchronize];
        }
        [self.window makeKeyAndVisible];
        return YES;
    }
  • 相关阅读:
    JS-07 (js的面向对象编程)
    AI SiameseFC
    phpstorm调试
    Php 编译扩展
    canvas
    AI FCN
    AI WebGL
    Python flask
    JIT 即时编译
    小程序
  • 原文地址:https://www.cnblogs.com/qq449832375/p/4677051.html
Copyright © 2011-2022 走看看