I’m trying to do some progress indication for when trying to upload and download a file.
Been reading and looks like this is the method that I need to use.
- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
I’d like to read more about how that function works (i.e when is it called etc), but can’t seem to find the reference documentation. I went to this URL but it does not say anything about that particular function.
Where can I read more about it?
Thank you,
Tee
NSURLConnectionhad an informal protocol for its delegate. That changed in iOS 5 (I think the same happened on OSX). They deprecated the methods declared inNSURLConnectionand moved them into formal protocolsNSURLConnectionDelegateandNSURLConnectionDataDelegate.And now the fun part. They deprecated the methods, they even removed them from the
NSURLConnectiondocumentation but they did not document the new formal protocols.Currently, only
NSURLConnectionDelegateis documented.NSURLConnectionDataDelegateis not mentioned anywhere.There are two ways how to find what the method does.
Look into the previous version of
NSURLConnectiondocs (e.g. iOS 4.3). I would give you a link but I couldn’t find it online. Maybe you have the library downloaded in your XCodePress cmd-shift-o in Xcode, type
NSURLConnectionDataDelegateand press enter. You have found the header and the methods have a description there: