的是我的代碼NSURLConnection的不調用連接:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:
theDownloadConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
,它是調用這些NSURLConnection的委託方法
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
但他並沒有叫
- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten
totalBytesWritten:(NSInteger)totalBytesWritten
totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite;
當我這樣做時,NSURLConnection委託調用的這種方法
[NSURLConnection connectionWithRequest:request delegate:self];
我不明白爲什麼會發生這種情況?
@EdwinIskandar我遇到同樣的問題,但我肯定使用HTTP POST(帶文件上傳)。你知道NSURLConnection需要滿足什麼其他期望來調用'didSendBodyData'方法嗎? –