Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7 from miklselsoe/master

Send notifications on the main thread.
  • Loading branch information...
commit 49e9f0b107fb094a391c37c7cb8c78bac3f5bbe0 2 parents cfbb1cc + 3cce5f7
@GlennChiu authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 GCNetworkReachability.m
View
8 GCNetworkReachability.m
@@ -390,9 +390,11 @@ static void GCNetworkReachabilityCallbackWithBlock(SCNetworkReachabilityRef __un
static void GCNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info)
{
GCNetworkReachabilityStatus status = GCNetworkReachabilityStatusForFlags(flags);
- [[NSNotificationCenter defaultCenter] postNotificationName:kGCNetworkReachabilityDidChangeNotification
- object:(__bridge GCNetworkReachability *)info
- userInfo:@{kGCNetworkReachabilityStatusKey : @(status)}];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:kGCNetworkReachabilityDidChangeNotification
+ object:(__bridge GCNetworkReachability *)info
+ userInfo:@{kGCNetworkReachabilityStatusKey : @(status)}];
+ });
GCNetworkReachabilityPrintFlags(flags);
}
Please sign in to comment.
Something went wrong with that request. Please try again.