I want to store bool value in KeychainItemWrapper, how to store ?
I have tried this code, but it gives me error.
[keychain setObject:YES forKey:(__bridge BOOL)kSecAttrIsInvisible];
I want to store bool value in KeychainItemWrapper, how to store ?
I have tried this code, but it gives me error.
[keychain setObject:YES forKey:(__bridge BOOL)kSecAttrIsInvisible];
Also you can use Shorthand like
The
BOOL
is a primitive type and thesetObject:forKey:
only excepts classes that derive fromNSObject
.So use
NSNumber
it has a special method for it+ numberWithBool:
:And if you need to bool again: