Answer the question
In order to leave comments, you need to log in
How to store the information the user has entered in the appdelegate?
Good day to all!
When the application is launched for the first time, the user enters a username and password and switches to another view.
How to make sure that after closing the application, the login and password are saved in the iPhone's memory and when the application is reopened, it no longer enters the login and password, but immediately switches to another view.
Tell me please :)
Answer the question
In order to leave comments, you need to log in
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:login forKey:@"login"];
[userDefaults setObject:password forKey:@"password"];
login = [userDefaults objectForKey:@"login"];
password = [userDefaults objectForKey:@"password"];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question