If you are doing this in a background thread, the thread is likely to exit before calling delegates. Look at the call to your method, which starts the transfer right after the call to the method that starts the background thread, CFRunLoopRun (). Then in your callbacks connectionDidFinishLoading:and connection:didFailWithError:make sure that you also run:
CFRunLoopStop(CFRunLoopGetCurrent());
At the end of these methods, otherwise you will never return.
source
share