IOS Novice Guide added in the app, the first launch of the application appears, the back does not appear

Source: Internet
Author: User


1, found in the appdelegate.m "application:didfinishlaunchingwithoptions:"

Judging by the nsuserdefaults.

if   (![ [ nsuserdefaults standarduserdefaults]  boolforkey

        [[ standarduserdefaults: yes forkey: Span style= "margin:0px;padding:0px;" >@ "everlaunched"

        [[ standarduserdefaults: yes forkey: Span style= "margin:0px;padding:0px;" >@ "Firstlaunch"

NSLog(@ "first launch");

}Else {

        [[ standarduserdefaults: no forkey: Span style= "margin:0px;padding:0px;" >@ "Firstlaunch"

NSLog(@ "second launch");

}

2, in Rootviewcontroller's Viewwillappear: The method inside to add

if   ([[ nsuserdefaults standarduserdefaults: @ "Firstlaunch" ]) {

        [[ standarduserdefaults: no forkey: Span style= "margin:0px;padding:0px;" >@ "Firstlaunch"

         userguidecontroller *userguide = [[[ Userguidecontroller]  ]  autorelease ";

[self presentmodalviewcontroller: userguide animated:YES];

}

3, in the Settings page can also add the same view, so that users can view.


This article is from the "zhuoking" blog, make sure to keep this source http://9951038.blog.51cto.com/9941038/1746336

IOS Novice Guide added in the app, the first launch of the application appears, the back does not appear

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.