RestKit/RestKit — Issue #580: [Suggestion]Use CFNetwork instead of NSURLConnection?
Author: aelam
Created: 2012-03-04 15:51:54+00:00
State: open

you could make app crash every time follow these steps
1. pop to a viewcontroller
2. do a request by RKRequest in this view controller and the delegate is this view controller
3.quickly pop view controller and it's released! (in this term the request is running)
4.when the request finished, its delegate(assign) is released,
5.crash

@blakewatters
My understanding
**NSURLConnection's delegate is retained**, its delegate is RKClient, RKClient's delegate is ViewController(assign), when view controller is popped RKClient's delegate(view controller) is released but not nil, when NSURLConnection finished or error happened, RKClient get the response and then RKClient invoke its delegate(ViewController), but view controller is released ,then app crashed!

This problem can happened if you do a wrapper of NSURLConnection, when wrapper's delegate is assigned rather then retained
OR there is a good way to avoid this happen, when pop view controller?