zoukankan      html  css  js  c++  java
  • 本地持久化存储

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

        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];

    }

  • 相关阅读:
    多线程 execute和submit区别和使用
    Linux上安装rz和sz命令
    杜恩德__百度百科
    电商类-高并发场景处理方式一
    ConcurrentHashMap源码分析(1.8)
    JVM | 为何生产环境最好保持 Xms = Xmx
    分享ProcessOn网上的干货模板
    pythonweb开发
    pyquery
    python正则
  • 原文地址:https://www.cnblogs.com/lion-witcher/p/5167396.html
Copyright © 2011-2022 走看看