Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Calling stringForKey sometimes returns nil for keys that previously worked #21

Closed
bedaronco opened this issue Sep 13, 2015 · 8 comments
Closed

Comments

@bedaronco
Copy link

I'm getting some strange behavior when accessing data. I have a static method that I use to retrieve a stored auth token for an API call. This static method is called a couple times and returns the data I expect. From one of my view controllers though it's returning nil.

I make the exact same call for the exact same keys. Two calls return data and the last one does not. I'm getting a return status of -34018. I'm not sure what that error code is.

@hgwhittle
Copy link

I'm seeing the same issue.

@bedaronco
Copy link
Author

This looks like a bug in iOS and only when running in the debugger. I'm seeing some discussions elsewhere saying they see the same thing. When I run outside of the debugger I don't ever see the problem. Very strange and quite annoying.

@hgwhittle
Copy link

Does anyone know of a workaround?

@bedaronco
Copy link
Author

I have not seen one. Lots of people saying reboot your device and then try. That does seem to occasionally work. Nothing seems permanent though.

@kanekin
Copy link

kanekin commented Dec 14, 2015

Does it happen when the app is in the background? If so it could be related to this: http://stackoverflow.com/questions/10536859/ios-keychain-not-retrieving-values-from-background/10583042#10583042

@jrendel
Copy link
Owner

jrendel commented Dec 14, 2015

Also see this issue if its related to the background issue: #29

@JuanPabloBoero
Copy link

Anyone suffering from this issue, please do a clean install and ALSO remove all keychain objects, and try again, i think it is something with the overwriting.

The method is not yet on the class, but there is a Issue covering it:Remove all objects method

@jrendel
Copy link
Owner

jrendel commented Oct 1, 2016

Was this issue originally occurring only on the simulator? I'm seeing a similar issue this year running on the iOS 10 simulator. #59

Going to close this issue.

@jrendel jrendel closed this as completed Oct 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants