You can still save the username and server URL using NSUserDefaults, but Keychain services are the best idea if you keep the password. This is part of the C-based security infrastructure, and there is an excellent SFHFKeychainUtils wrapper class to give it the Objective-C API.
To save:
NSString *username = @"myname";
NSString *password = @"mypassword";
NSURL *serverURL = [NSURL URLWithString:@"http://www.google.com"];
[SFHFKeychainUtils storeUsername:username andPassword:password forServiceName:[serverURL absoluteString] updateExisting:YES error:&error]
Recovery:
NSString *passwordFromKeychain = [SFHFKeychainUtils getPasswordForUsername:username andServiceName:[serverURL absoluteString] error:&error];
source
share