4

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.'

Karthik
  • 934
  • 9
  • 21

1 Answers1

3

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

Karthik
  • 934
  • 9
  • 21
  • Is this a guess or you have some official confirmation? – AXE Jun 09 '14 at 13:37
  • 1
    Its official. Please go through pre-release documentation. – Karthik Jun 09 '14 at 17:31
  • 1
    With xcode beta 3 I still have this issue in ios simulator: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Problem deleting current dictionary.' – Yann86 Jul 25 '14 at 08:42
  • 1
    I'm getting this same error (Problem deleting current dictionary). Haven't changed the code at all from xcode 7 but now on xcode 8 I get it. Also- I don't get the error when running on a device- only on the simulator. Not sure if this is an Xcode bug or something I need to change with regard to the Keychain access methods. – Jim Sep 19 '16 at 23:51