iOS/iPhone Reachability - How to only check when internet is lost/not reachable using Reachability.m/.h

前端 未结 7 476
一生所求
一生所求 2021-02-01 09:59

Currently i am using the class by apple reachability.m/.h and it works, except it notifies me for any change, where as i would like to only notify the user if the network is not

7条回答
  •  花落未央
    2021-02-01 10:29

    With Reachability 2.2, you can add

    [hostReach connectionRequired];
    

    before

    [internetReachable startNotifier];
    

    to solve this problem.

    runmad answered this problem here: https://stackoverflow.com/a/2157858/623260

提交回复
热议问题