iPhone - How to find NSURLConnection started or not?
There's a delegate in NSURLConnection "- (void)connectionDidFinishLoading:(NSURLConnection *)connection"
开发者_开发问答
This will be called when the connection finishes. But is there any delegate or way to know when the connection has started.
What you're looking for is the NSURLConnection delegate method connection:willSendRequest:redirectResponse:
. It will be called once when the connection starts, but be warned that it will be called again for every redirect response (if there are any).
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
can be used.
精彩评论