reachabilityWithHostName Example

前端 未结 1 1115
一向
一向 2020-12-21 23:38

i read the https://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html my Question is if the www.apple.com is become not active Suddenly..this c

相关标签:
1条回答
  • 2020-12-22 00:25

    That's absolutely right.

    It will fire off a kReachabilityChangedNotification notification that tells you the new reachability state.

    You get the new reachability state something like this :

    - (void)reachabilityChanged:(NSNotification *)notification {
        Reachability *reachability = notification.object;
    
        if (NotReachable == reachability.currentReachabilityStatus)
            NSLog(@"No longer reachable");
    }
    
    0 讨论(0)
提交回复
热议问题