In my app, I created a first ViewController (in storyboard) called welcome, with all the instructions. At the end of the page, I wanted to insert a box that could be selected showing "don't show again". By clicking on this box, and going to the next page, the first viewController will vanish. When I reopen the app, the controller won't be shown again. The only way to show it is by going on settings and selecting the switch "repristinate original settings" or something like that. Please, can anyone help me? Thanks!
I found an example but is not what I want:
- (IBAction)leggi{
NSString *stringaTesto = campo.text;
testo.text = [[NSString alloc] initWithFormat:@"%@", stringaTesto];
NSString *testoInserito = testo.text;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:testoInserito forKey:@"ciao"];
[defaults synchronize];
}
- (void)viewDidLoad
{ [super viewDidLoad]; NSString *testoSalvato = [[NSUserDefaults standardUserDefaults] objectForKey:@"ciao"]; if (testoSalvato == nil) { testo.text = @"Non hai ancora inserito il tuo nome"; } else { testo.text = [[NSString alloc] initWithFormat:@"Ciao %@", testoSalvato]; }
}
The IB Outlet is linked to a button