iOS: reachability and AFNetworking -


I have this code in your AppDelegate:

  - (bool) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions {[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock: ^ (AFNetworkReachabilityStatus status) {if (state == AFNetworkReachabilityStatusNotReachable) {NSLog (@ "no connection"); } Else if (state == AFNetworkReachabilityStatusReachableViaWiFi || state == AFNetworkReachabilityStatusReachableViaWWAN) {NSLog (@ "No connection"); }}]; [[AFN Network Reachability Manager Shared Manager]] StartMoning]]; Yes come back }  

But this does not work, I am not my log, why?

block only when called reachability actually turns into

you You can get the current situation like:.

  [[AFNetworkReachabilityManager sharedManager] accessible]  

Comments

Popular posts from this blog

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - Split String between 2 substrings without removing delimiters -