当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - iPhone - multiple calls in background

问题描述:

Following is the scenario:

listOfUserIds - An array containing user id's

I need to make a service call with each user id and get the full name for that user. It should happen asynchronously, as there are thousands of users.

Two approaches i can think of:

1) Make a service call in the background and wait for it's response. Once i have the response, i will make the second service call. If this is the right approach, how it can be done?

2) Start seperate thread for all service calls, and handle their responses in some method in background thread only.

I tried the second approach but since the response is received in delegate methods, i am not getting success in it.

Can anyone please tell me about a good approach with some psuedo code?

分享给朋友:
您可能感兴趣的文章:
随机阅读: