On my single view I have upload and download option of image and audio file, I successfully implemented the download code with progress bar indicating download progress.
I am having issue in showing uploading progress, currently I am using [NSURLConnection sendAsynchronousRequest:
but I also want to show upload progress, this method has no callback block or delegate function regarding data progress. So I tried to use connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:
but how this method will trigger?
For downloading I am doing this to trigger NSURLConnectionDataDelegate methods and getting my job done.
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
If i use [NSURLConnection connectionWithRequest:someReq delegate:self]
for uploading, I will be setting delegate twice in one file, first when uploading method is called and second when download method is called, Is this a correct approach?
Finally how [NSURLConnection sendAsynchronousRequest:
is useful, it has no delegate or callbacks regarding data progress, why to use it?