以下のこのコードについて疑問に思っています...インターネット接続をオフにして実行すると、コンソールログに「接続に失敗しました」と表示されると予想していました。なぜ私がいないのか誰かが説明できますか?ありがとう。
NSString *urlString = [NSString stringWithFormat:@"http://www.myurl.com/RSS/feed.xml"];
NSURL *serviceURL = [NSURL URLWithString:urlString];
//Create the request
NSURLRequest *request = [NSURLRequest requestWithURL:serviceURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30];
//Create the connection and send the request
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
//Make sure the connection is good
if (connection) {
//instantiate the responseData structure to store the response
self.responseData = [NSMutableData data];
}
else {
NSLog(@"Connection failed");
}