0

I am using socket for send and receive data runtime but in some cases, i still need to wait the response from server. In http request, i use:

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    dispatch_async(dispatch_get_main_queue(), ^{
    });
});

In another way, i using socket and have a request to server CheckVersion:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //check update version 
}

After that, i have to wait response from socket. If version is no longer support, an alertview should show and prevent the FirstViewController show.

How could i wait socket response? Thanks in advance.

Jonny Vu
  • 1,420
  • 2
  • 13
  • 32

0 Answers0