Question

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

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

Was it helpful?

Solution

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

OTHER TIPS

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");
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top