私は2AFJSONRequestOperation
つのView Controllerから2つを実行しています。それらは次々に呼び出されます:
ビューコントローラー1:
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON){
//
}failure:^(NSURLRequest *request, NSHTTPURLResponse *response,NSError *error, id JSON){
//
}];
[operation start];
[SVProgressHUD showWithStatus:@"Searching for products, please wait.."];
ビューコントローラー2:
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON){
//
}failure:^(NSURLRequest *request, NSHTTPURLResponse *response,NSError *error, id JSON){
//
}];
[operation start];
[SVProgressHUD showWithStatus:@"Loading categories.."];
問題は、表示されるステータスが 2 番目の操作のみであることです。Loading categories..
ただし、ネットワークと JSON 結果の取得の両方を正常に完了しました。
NSOperationQueue
2つの操作が別々のコントローラーにあるため、使用できないようです。では、両方のステータス メッセージをユーザーに表示するために、最初のメッセージが完了するまで待機させるにはどうすればよいでしょうか。