Replace dispatch_sync with dispatch_async in pairing

This commit is contained in:
Cameron Gutman
2015-07-09 21:02:19 -07:00
parent 0bdc5a83f1
commit 05f0dfd4f5

View File

@@ -40,7 +40,7 @@ static NSMutableSet* hostList;
static NSArray* appList;
- (void)showPIN:(NSString *)PIN {
dispatch_sync(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_main_queue(), ^{
_pairAlert = [UIAlertController alertControllerWithTitle:@"Pairing"
message:[NSString stringWithFormat:@"Enter the following PIN on the host machine: %@", PIN]
preferredStyle:UIAlertControllerStyleAlert];
@@ -50,7 +50,7 @@ static NSArray* appList;
}
- (void)pairFailed:(NSString *)message {
dispatch_sync(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_main_queue(), ^{
[_pairAlert dismissViewControllerAnimated:YES completion:nil];
_pairAlert = [UIAlertController alertControllerWithTitle:@"Pairing Failed"
message:message
@@ -64,7 +64,7 @@ static NSArray* appList;
}
- (void)pairSuccessful {
dispatch_sync(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_main_queue(), ^{
[_pairAlert dismissViewControllerAnimated:YES completion:nil];
[_discMan startDiscovery];
[self alreadyPaired];