2009-11-26 3 views
0

iphone 또는 objective-c를 통해 인터넷 연결을 확인하는 방법 ???인터넷 문제

+0

유사 : http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on 여기 – miku

+0

중복 된 http://stackoverflow.com/questions/1802592/internet-problem/1802657 – Lee

답변

0

빠른 및 Drity : Ping Google?

0

Reachability이 사과 샘플 코드 도달 가능성을 살펴 가지고 뭔가를 할 (또는 사용)하는 것입니다. 필요한 모든 것을 제공해야합니다.

[[Reachability sharedReachability] setHostName:@"example.com"]; 
if ([[Reachability sharedReachability] remoteHostStatus] == NotReachable) { 
    UIAlertView *dialog = [[[UIAlertView alloc] init] retain]; 
    [dialog setTitle:@"Server unreachable"]; 
    [dialog setMessage:@"The server is temporarily unavailable."]; 
    [dialog addButtonWithTitle:@"OK"]; 
    [dialog show]; 
    [dialog release]; 
} 
2

는 코드를 사용할 수 니펫 -iphone-sdk
관련 문제