iPhone: How to Determine When a Download from a URL has Completed
I need to populate an array using data from a NSURL
. How do I determine when th开发者_开发知识库e download from the URL has completed?
You usually use NSURLConnection and then set its delegate to whatever object controls the download. When NSURLConnection finishes it sends connectionDidFinishLoading:
to the delegate to signal completion.
See the URL System Programming Guide.
there is delegate method will be called when all the data from url is download.- (void)connectionDidFinishLoading:(NSURLConnection *)connection {}
精彩评论