2
NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:self.urlString]];
NSURLConnection *con = [[NSURLConnection alloc]
initWithRequest:req
delegate:self
startImmediately:NO];
[con scheduleInRunLoop:[NSRunLoop currentRunLoop]
forMode:NSRunLoopCommonModes];
[con start];
if (con) {
self.receivedData=[[NSMutableData alloc] init];
} else {
...
}
[req release];
使用此代碼,我正在下載圖像。如何在下載過程中停止/關閉NSLURLConnection
如何在下載過程中停止下載並關閉連接?
謝謝。你非常幫助我 – mrde 2011-12-17 12:52:05