L
L
Lorem Ipsum2014-09-20 14:24:30
Objective-C
Lorem Ipsum, 2014-09-20 14:24:30

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

2 answer(s)
M
ManWithBear, 2014-09-21
@GeorgeGeorge

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:login forKey:@"login"];
[userDefaults setObject:password forKey:@"password"];

login = [userDefaults objectForKey:@"login"];
password = [userDefaults objectForKey:@"password"];

L
Li_ Ma, 2014-09-20
@almadob

plist?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question