2015-10-16 36 views
0

我們如何調用同步調用但是,給出響應asynch.here是我的代碼。我們如何在iOS9中調用同步Web服務

NSURL *URL = [NSURL URLWithString:@"http://example.com"]; 
NSURLRequest *request = [NSURLRequest requestWithURL:URL]; 

NSURLSession *session = [NSURLSession sharedSession]; 
NSURLSessionDataTask *task = [session dataTaskWithRequest:request 
             completionHandler: 
    ^(NSData *data, NSURLResponse *response, NSError *error) { 
     // ... 
    }]; 

[task resume]; 

回答

0

我們不能也不可能。

以前的方法是暫停執行步驟,在獲取數據或超時後繼續執行。