开发者

Help with facebook multiple requests in IOS

开发者 https://www.devze.com 2023-04-03 23:22 出处:网络
I need to perform a series of FBrequests. Basically it is an array which for each item I have to make a FBrequest.

I need to perform a series of FBrequests. Basically it is an array which for each item I have to make a FBrequest.

What I need to know is if it is guaranteed that the order of the requests received by the - (void)request:(FBRequest*)request didLoad:(id)result method is the same of when the requests were made. In other words, in case the order of the requests is: FBrequest_1 -> FBrequest_2, is it guaranteed that the didLoad method will receive the responses as: FBresponse_1 -> FBresopnse_2? Or is it possible that the FBresponse_2 is received before the FBresponse_1?

Thanks in 开发者_StackOverflow社区advance!


By default the requests are independent. You can use "batch requests".

Here you can see "Specifying dependencies between operations in the request" section.


You can also initiate FBrequest_2 in the callback of FBrequest_1 (=FBresponse_1). Facebook SDK for iOS calls to FB asynchronously and each request has a callback with a response so just call your second request from that callback to make sure it is done alsready, you also can use the information you get from the response in your second request.

hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号