//下载结束,刷新 [self performSelectorOnMainThread:@selector(fillPhoto) withObject:nil waitUntilDone:NO]; // Release resources used only in this thread. self.connection = nil; [uploadPool release]; self.uploadPool = nil; _subThreed = nil; }
#pragma mark NSURLConnection Delegate methods
/* Disable caching so that each time we run this app we are starting with a clean slate. You may not want to do this in your application. */ - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse {
// Called when a chunk of data has been downloaded. - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { // Process the downloaded chunk of data. [characterBuffer appendData:data]; }
- (void)connectionDidFinishLoading:(NSURLConnection *)connection { [self performSelectorOnMainThread:@selector(httpConnectEnd) withObject:nil waitUntilDone:NO]; // Set the condition which ends the run loop. done = YES; }