You can use NSUserDefaults to save information about your application.
When the user successfully logs into your app, you can Store the status of a user perviously logging in correctly.
//SETTING USER DEFAULTS
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:txtUsername.text forKey:@"Username"];
[defaults setObject:txtPassword.text forKey:@"Password"];
[defaults setObject:"true" forKey:@"LoginStatus"];
[defaults synchronize];
//RETRIEVING USER DEFAULTS
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *Username = [defaults objectForKey:@"Username"];
NSString *Password = [defaults objectForKey:@"Password"];
NSString *Status = [defaults objectForKey:@"LoginStatus"];
Then once you have this working you can then apply some logic to it.
if ([Status isEqualToString:@"true"]) {
[self loginUser:Username :Password]
}
------ EDIT ------
Someone in comments said it may be trouble to store a password here.
Go to this: Queston to get a function to hash the password string.
Lastly thankyou to all those who voted me back into the positive.