AFNetworking/AFNetworking — pull request #843 by blakewatters (2013-03-08 01:51:34+00:00)
Title: Rework Notification Delivery to Avoid Crashes in Logging

This pull request rearranges the delivery of `AFNetworkingOperationDidStartNotification` and `AFNetworkingOperationDidFinishNotification` to avoid a particularly nasty crash due to timing between the start of the `NSURLConnection` and processing of the notification.

Myself and a number of RestKit users have experienced crashes when logging request activity at high level of verbosity. In all cases, you wind up with the main queue attempting to access a property of the `NSURLRequest` while an `AFURLConnectionOperation` is in the `operationDidStart` method and has passed the same `NSURLRequest` instance into `[NSURLConnection initWithRequest:delegate:startImmediately:]`.

Rearranging the delivery of the notifications after `NSURLConnection` is done eliminates the crashes.