smup/AFNetworking — pull request #1 by tangphillip (2014-11-06 21:06:43+00:00)
Title: Fix CFDictionaryGetValue crashes by using method swizzling instead of KVO

For background, see #1477. The tl;dr is that AFNetworking uses KVO in `AFURLSessionManager` to watch the state of `NSURLSessionTask`s...and that the KVO is causing LOTS of unreproducible crashes in production apps. It's Apple's bug, and we've filed lots of [bugs with Apple](http://openradar.appspot.com/18419882). They're looking at the bugs, but until they fix it, we should work around their problem.

I don't really expect this to be merged, since swizzling is pretty obviously bad practice. That said, this fix for #1477 has been tested in our production app, with 500,000 updates...and no more `CFDictionaryGetValue` crashes.

I have not tested this with background uploads or downloads. I have suspended a network call to see the `AFNetworkActivityIndicatorManager` stop the spinner, but our production app does NOT suspend network calls. I cannot say for certain that it will not cause problems if other apps do.