iphone - Multiple Users in the Keychain -
so got iphone app use keychain , store password.
keychainitemwrapper *kc = [[keychainitemwrapper alloc] initwithidentifier:@"password"]; [kc setobject:@"my_password" forkey:(id)ksecattraccessgroup]; [kc release]; this saves password correctly. tried pass string (username) instead of (id)ksecattraccessgroup relate password specific username, crashes.
question: how can relate stored password username, because app allows multipple user login.
i know it's not answer quesiton. use sfhfkeychainutils(github).
it's wrapper , allows looking for. store password associated username. here's code how did sfhfkeychainutils.
nsstring *username = @"username"; nsstring *password = @"password"; [sfhfkeychainutils storeusername:username andpassword:password forservicename:@"your app" updateexisting:yes error:null]; or pass pointer nserror object if want error information. ;-) hope answer you...
sandro meier
Comments
Post a Comment