Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1103565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:21:38+00:00 2026-05-17T01:21:38+00:00

In my iPad app, I have a UIAlertView which pops up upon start up,

  • 0

In my iPad app, I have a UIAlertView which pops up upon start up, however I only want this to popup the very first time the user starts the application. It’s a setup prompt, saying, it’s your first time, would you like to setup?

How can I do this? I have heard it’s best to write out to a plist file and save a bool value, but how would I tackle this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:21:38+00:00Added an answer on May 17, 2026 at 1:21 am

    Modify the following code to suit your needs; you may put it in your root view controller viedDidLoad method. The code keeps track of the first run of the application, of the number of launches and whether or not the your setup prompt has been shown to the user.

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    if (![defaults objectForKey:@"firstRun"]) {
    
        // this is the first run 
        // store this information
    
        [defaults setObject:[NSDate date] forKey:@"firstRun"];
        [defaults setInteger:1 forKey:@"launches"];
        [defaults setBool:NO forKey:@"setupPromptHasBeenShown"];
        [defaults synchronize];
    
        // now prompt the user to setup the app 
        // once the the prompt has been shown, 
        // if the user actually decides to setup the app, 
        // store this information again, so you will not prompt him/her again
        [defaults setBool:YES forKey:@"setupPromptHasBeenShown"];
        [defaults synchronize];
    
    }
    else{
         // this is not the first run
         NSInteger daysSinceInstall = [[NSDate date] timeIntervalSinceDate:[defaults objectForKey:@"firstRun"]] / 86400;
         NSInteger launches = [defaults integerForKey:@"launches"];
         [defaults setInteger:launches+1 forKey:@"launches"];
         [defaults synchronize];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

strong textI have an iPad app which only allows landscape orientation, and launches in
I have developed an ipad app and want to send this build to the
I have created an iPad app which I want to send to another branch
I have an iPhone/iPad app which play a HTTP Live Stream of a tv
I have an iPad app which has a funky Path-style menu which is present
I have a iPad app which is NOT modified for the new iPad with
I have this iPad app using Storyboard. There are some file that are marked
I have a basic iPhone/iPad app which has a ; a. List view &
I'm working on a very complex iPad app which may run about 10 separate
I have developed the ipad app which displays images and other product details from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.