0
我困在連續執行Afnetworking操作。目前我能夠獲得所有的操作響應,但這些不是連續的。我需要使它串行。同步AFNetworking操作和解析
我在做什麼是
for (int i = 0; i < myArray.count; i++) {
//Creating Soap Request
// Adding that SoapRequest to Operation
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
// On success I am parsing the response
// Parsing is executed here..
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
// Failure message
}
// If Network is reachable then adding the Operation in queue
[[PFAPIClient sharedClient] enqueueHTTPRequestOperation:operation];
// Adding the operation (For multiple execution of operations)
}
因此我得到的迴應是不連續的。請幫助我。 那麼如何連續獲得此響應,並相應地解析響應。經過成功解析我已經顯示他們..
我已經添加了操作隊列中的所有操作並將最大併發操作數設置爲1.它對我有效.. @Rob感謝您的回覆! – iCoder 2014-10-21 05:06:38