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

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

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -