Objective c NSURLConnection中的担保订单

Objective c NSURLConnection中的担保订单,objective-c,ios,Objective C,Ios,让我从一些代码开始。当应用程序加载时,它调用以下命令: //Creates custom URL for request, loads the request, and upon completion (as per the delegate response, it runs the selector) //List of programs URLCreator * getListURL = [[URLCreator alloc] initStandard:@"getList"]; WebM

让我从一些代码开始。当应用程序加载时,它调用以下命令:

//Creates custom URL for request, loads the request, and upon completion (as per the delegate response, it runs the selector)

//List of programs
URLCreator * getListURL = [[URLCreator alloc] initStandard:@"getList"];
WebManager *getListWM = [[WebManager alloc]init];
[getListWM load:[getListURL finalURL] withSelector:@selector(createProgramList)];

//Sorting order for program list
URLCreator * getSortURL = [[URLCreator alloc] initStandard:@"getSort"];
WebManager *getSortWM = [[WebManager alloc]init];
[getSortWM load:[getSortURL finalURL] withSelector:@selector(sortThroughPrograms)];
到目前为止,这段代码运行得很好,除了一件事——我的回答出了问题。这是意料之中的,因为程序列表比排序顺序大得多。基本上,我需要做的是,在我可以执行任何类型的排序算法之前,我需要保证我有程序列表和排序顺序


在不通过执行同步请求锁定程序的情况下,在执行排序算法之前,最好的方法是什么?当然,我可以设置BOOL标志,但我需要经常检查,看看何时收到了这两个标志

您可以为此使用NSOperationQueue。