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

  • Home
  • SEARCH
  • 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 8650099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:43:57+00:00 2026-06-12T13:43:57+00:00

I am creating a Disclaimer that will be shown when the user first launches

  • 0

I am creating a Disclaimer that will be shown when the user first launches the app. The disclaimer is an alertView with 2 option. If user agrees then firstViewController will display. If he doesn’t he will be redirected to another viewController. But I can’t get the disclaimer to disappear if the user agrees the first time. It is shown every time the app launches. Any help would be appreciated. Thank you in advance..

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

      if (![[defaults valueForKey:@"keyDisclaimer"] isEqualToString:@"accepted"]) {

UIAlertView *disclaimer = [[UIAlertView alloc] initWithTitle:@"Read Before use" message:@"By using this app you agree to its terms and conditions.\n\n\n\n\n\n\n\n\n\n\ntext heren\n\n\n\n\n\n\n\n\n\n\n\n\n" delegate:self cancelButtonTitle:@"No!" otherButtonTitles:@"Yes Let me In", nil];

[disclaimer show];

}

// Override point for customization after application launch.
return YES;
}

-(void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
NSString *buttonString = {[alertView buttonTitleAtIndex:buttonIndex]};

if ([buttonString isEqualToString:@"Yes Let me In"]) {
    NSMutableDictionary* defaultValues = [NSMutableDictionary dictionary];

    [defaultValues setValue:@"accepted"forKey:@"keyDisclaimer"];

    [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];



}
else if ([buttonString isEqualToString:@"No!"]) {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sorry!" message:@"You are not allowed to use this app due to the fact that you did not agree to the terms and Conditions. Please exit this app!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    [alert show];

 //  [[NSUserDefaults standardUserDefaults] setValue:@"notAccepted" forKey:@"keyDisclaimer"];
 }

   if ([buttonString isEqualToString:@"OK"]) {
       introViewController *intro = [[introViewController alloc] initWithNibName:@"introViewController" bundle:nil];

      _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

       _window.rootViewController = intro;
       [_window makeKeyAndVisible];
   }
 }
  • 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-06-12T13:43:59+00:00Added an answer on June 12, 2026 at 1:43 pm
    NSMutableDictionary* defaultValues = [NSMutableDictionary dictionary]; 
    [defaultValues setValue:...forKey:...]
    [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
    

    This will register your defaults if they are not set (for the first time)

    Also, seems like you’re forgetting [defaults synchronize] to commit changes after setting values. If so, you don’t need the registerDefaults method at all.

    Like this:

    if ([buttonString isEqualToString:@"Yes Let me In"]) {
        NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
        [defaults setValue:@"accepted"forKey:@"keyDisclaimer"];
        [defaults synchronize];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a patch utility that will update my current website with my patch. when
My fellow developer and I are creating an iPhone app that is creating a
creating a very simple scheduling app I am asking the user to tell me
Creating a simple app that calculates the speed your going and displays it in
I'm creating an app that needs to be accessed by both a web front
Creating an a app, where I store bunch of photos in the drawable folder,
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
Creating a google map with store locations within 50 miles of user entered address.
Creating a server-side socket will fail if I'm trying to use the same port
Creating a simple RPG game, first time using XNA. Trying to get my character

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.