• 本地持久化存储


    //用持久化对象去存储一个字符串作为标识,如果找到标识用户不是第一次登陆,就加在主界面,如果找不到,说明用户是第一次登陆,加载引导界面.

        if (![[NSUserDefaults standardUserDefaults] boolForKey:@"ccc"]) {

            UserGuideViewController *guideVC = [[UserGuideViewController alloc] init];

            self.window.rootViewController = guideVC;

            [guideVC release];

        }else{

            RootViewController *rootVC= [[RootViewController alloc] init];

            self.window.rootViewController = rootVC;

            [rootVC release];

        }

    在userGuide最后一页加一个tap手势,给手势添加一个轻拍事件

    - (void)handleTap:(UITapGestureRecognizer *)tap{

        //1.将字符串持久化存储

        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"ccc"];

        //立刻同步(立刻存储)

        [[NSUserDefaults standardUserDefaults] synchronize];

        //2.进入主页面

        RootViewController *rootVC = [[RootViewController alloc] init];

        [UIApplication sharedApplication].keyWindow.rootViewController = rootVC;

        [rootVC release];

    }

  • 相关阅读:
    baremetal node & openstack hypervisor &openstack flavor
    bridge fdb vxlan nolearning
    bridge fdb 与vxlan
    FRRouting Architecture
    bridge fdb Command Output
    while循环和until语句
    Python私有属性和私有方法
    python面向对象封装案例2
    Python面向对象封装案例
    Python类和对象
  • 原文地址:https://www.cnblogs.com/lion-witcher/p/5167396.html
Copyright © 2020-2023  润新知