NSURLConnection的委托方法我是从苹果公司运行下面的示例代码 -不执行
NSString *requestURL = [[NSString alloc] initWithString:@"http://google.com/"];
NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:requestURL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if(theConnection) {
NSLog(@"The connection has started...");
} else {
NSLog(@"Connection has failed...");
}
但低于委托方法不被调用。任何人都可以请帮我吗?
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {