문제

I'm using the UICKeyChainStore framework to save data to keychain.

How can I verify that the data is saved to the keychain?

도움이 되었습니까?

해결책

You can get data back after storing in this way:

NSString *name = [UICKeyChainStore stringForKey:@username" service:@"username"];

and then compare the strings to make sure that the value is saved

Alternatively, you can also use the following library. https://gist.github.com/dhoerl/1170641

다른 팁

UICKeyChainStore's setString forKey method returns the bool value , You can add a check on it.

BOOL result = [UICKeyChainStore setString:@"value" forKey:@"key"];
    if (result) {
        NSLog(@"data saved successfully");
    } else {
        NSLog(@"problem in saving");
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top