Created
June 18, 2013 21:41
-
-
Save MattFoley/5809710 to your computer and use it in GitHub Desktop.
Logout wait for synchronous network requests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch_async(dispatch_get_main_queue(), ^{ | |
[self.dialog setTitleString:@"Logging Out..."]; | |
<Show Dialog> | |
}); | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
#warning This would be better if our Network Utility ran off of the delegate protocol so we could cancel Network Requests. | |
do { | |
usleep(NSEC_PER_MSEC); | |
} while ([UIApplication sharedApplication].networkActivityIndicatorVisible); | |
usleep(NSEC_PER_MSEC); | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
<Dismiss HUD> | |
<Continue Logout> | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment