is [NSURLCredentialStorage sharedCredentialStorage] thread safe?

Is it safe to manipulate the object obtained from [NSURLCredentialStorage sharedCredentialStorage] from a non-main thread context (E.G. a serial dispatch queue) when there's a web view control on the main thread?


Apologies if this is in the wrong section, cross-posted under suggestion from http://stackoverflow.com/questions/31432418

is [NSURLCredentialStorage sharedCredentialStorage] thread safe?

Yes.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks very much for the response, could you tell me how you worked this out? Is it in the documentation/specification/errata somewhere, or heavily implied in a design document?

It's heavily implied by the design. It's obviously safe for your main thread code to access the shared credential store and CFNetwork has a number of secondary threads that also access that same store.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
is [NSURLCredentialStorage sharedCredentialStorage] thread safe?
 
 
Q