Spartacus9
Spartacus9

Reputation: 174

Are NSString and NSData the only types I can insert into KeyChain?

You can convert an integer to NSString or an array to NSData and insert them into the iOS KeyChain.

My question is: Is that it? Or is there a direct way to insert a double, float or a boolean?

Upvotes: 0

Views: 195

Answers (1)

kamil3
kamil3

Reputation: 1252

You can store primitive types in form of NSNumber and save them to keychain. It has methods like: numberWithBool:, numberWithInteger:, numberWithFloat:.

Here and here are examples of storing BOOL in keychain.

Upvotes: 1

Related Questions