Closed esromneb closed 11 years ago
AFCache isn't set up to be thread-safe, i.e. you can not use it from more than one thread.
Great, thanks for this info!
Hi - is it still the case that AFCache can only be used from a single thread? I've inherited some code that uses AFCache and am seeing issues when accessed from different threads:
* Terminating app due to uncaught exception 'NSGenericException', reason: '* Collection <__NSArrayM: 0x29a2350> was mutated while being enumerated.'
Thanks!
Hi,
yes, AFCache is still not thread-safe.
Thanks for the very quick confirmation - appreciated.
I am making a call like this: [[AFCache sharedInstance] cachedObjectForURL: [NSURL URLWithString:aUrl] delegate: self selector: @selector(connectionDidFinish:) didFailSelector: @selector(connectionDidFail:) options: 0 userData: (id)type username: nil password: nil];
When I make this call on the main thread, everything works great, but If I make this call from a thread that is in the background like this:
[self performSelectorInBackground:@selector(sel) withObject:nil];
I never get the callback. Any ideas here?