简体   繁体   中英

Asynchronously check for Reachability on iOS

I'm new to developing on iOS and in Objective-C.

According to this technical note ( https://developer.apple.com/library/ios/qa/qa1693/_index.html ), It is recommended to check for Reachability using async APIs on app startup, in order to prevent the app from being killed by the Watchdog.

I have looked at the samples + documentation here: SCNetworkReachabilitySetCallback

This allows registering a callback that is asynchronously invoked when reachability state changes.

However, this does not solve the issue of detecting what the state is RIGHT NOW (the callback is only raised on changes to reachability state).

What is the preferred way of getting the reachability state flags ? is there an Async API for that ?

我将看一下使用Tony Million可达性类的本教程

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM