KeychainItemWrapper Crashing for iOS8

2019-04-10 07:45发布

I'm using KeychainItemWrapper for my application using the following line of code

KeychainItemWrapper *currentUser = [[KeychainItemWrapper alloc] initWithIdentifier:@"com.example" accessGroup:nil];
[currentUser setObject:accountString forKey:CFBridgingRelease(kSecAttrAccount)];

accountString is a string containing my user information.

The code works perfectly fine with iOS7 but crashes with iOS8.

I'm not sure what i'm doing wrong., can someone please help!! I'm running the application on a simulator.

update: Here is the crash

* Assertion failure in -[KeychainItemWrapper writeToKeychain]

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'

1条回答
时光不老,我们不散
2楼-- · 2019-04-10 08:12

Looks like the first BETA version doesn't support Keychain Access developer APIs on the simulator. Hopefully this is brought in soon.

Update: looks like issue is fixed in Beta 2

查看更多
登录 后发表回答