- (void)start {
if (![self isCancelled]) {
NSLog(@"start operation");
// 以异步方式处理事件,并设置代理
_connection=[[NSURLConnection connectionWithRequest:_request delegate:self]retain];
//start方法是NSOperation类的主方法,这个方法执行完后,NSOperation的
//执行线程就结束了,同时该类的实例就会被释放,也就意味着你定义的代码包括delegate
//方法也不会被执行,while退出的条件是HTTP连接终止
while(_connection != nil) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}
}
}