との接続:私はこのコードを使用していNSURLRequest
NSString *recievedData;
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.site.com/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
// Create the NSMutableData to hold the received data.
// receivedData is an instance variable declared elsewhere.
recievedData = [NSMutableData data];
NSLog(@"%@", recievedData);
} else {
// Inform the user that the connection failed.
NSLog(@"Unsuccessful.");
}
それはthisの修正版です。
私の問題は、それは常に私がインターネットに接続されてるかどうか、それは常に成功に行くかどうか
<>
を返すということです。