1

My password store doesn't seem to be compatible across different XCode builds.

I'm managing a password with SFHFKeychainUtils. If I build my app with XCode 4.6.3, then do a subsequent build with XCode 5.0, I am getting a (null) back from this call:

NSString *p = [SFHFKeychainUtils getPasswordForUsername:username andServiceName:DEF_SERVICENAME error:&error];

and I stored it using this call:

[SFHFKeychainUtils storeUsername:username andPassword:password forServiceName:DEF_SERVICENAME updateExisting:YES error:&error];

Has anyone experienced similar issues and have you found a solution for dealing with this? It will be bad if my updated app can't read the stored data from my current app.

This line is getting the exact same dictionary in both builds:

OSStatus status = SecItemCopyMatching((CFDictionaryRef) attributeQuery, (CFTypeRef *) &attributeResult);

I get the following error:

 errSecItemNotFound                          = -25300,  /* The specified item could not be found in the keychain. */
dasdom
  • 13,975
  • 2
  • 47
  • 58
HalR
  • 11,411
  • 5
  • 48
  • 80
  • When the string comes back NULL, what does the `error` look like? – user1118321 Nov 08 '13 at 17:04
  • Add `error` content, check the issue with ad-hoc release builds instead of running the same target with different versions of Xcode. – A-Live Nov 08 '13 at 17:14
  • You have the code, trace into it with the Xcode debugger. – zaph Nov 08 '13 at 18:14
  • @Zaph I didn't notice your comment from earlier. Is there a way to step through and see how SFHFKeyCheainUtils is getting the password? – HalR Nov 25 '13 at 04:50

0 Answers0