tonymillion / Reachability

ARC and GCD Compatible Reachability Class for iOS and MacOS. Drop in replacement for Apple Reachability
BSD 2-Clause "Simplified" License
6.98k stars 1.26k forks source link

iOS12 bug, API cannot callback normal! #171

Open Cellphoness opened 5 years ago

Cellphoness commented 5 years ago

mac environment, simulator ios12, when I shortdown the WIFI, Reachability calback NotReachable. then i connect to WIFI, Reachability cannot callback any more! I set breakpoint in Reachability.m to monior `static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) {

pragma unused (target, flags)

NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
NSCAssert([(__bridge NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback");

Reachability* noteObject = (__bridge Reachability *)info;
// Post a notification to notify the client that the network reachability changed.
[[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];

}` the bug just appears in ios12, it totally seems fine in my ios10 simulator...

854907646 commented 5 years ago

I meet the same question too.