2011-11-15 42 views

回答

4

如果其有關失敗的互聯網連接,你可以使用的NSURLConnectionDataDelegate方法之一:

-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 
{ 

UIAlertView*aview=[[UIAlertView alloc]initWithTitle:@"Connection Failed" message:@"Please check your internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil ]; 
[aview show]; 
[aview release]; // Notify the user about the failure. 

NSLog(@"Reason:%@",[error description]); 
} 
+0

確定如何現在也映射這個答案是正確的: - ) – XpApp

+0

您可以點擊左側的刻度線,謝謝 – iNoob

相關問題