Having two Facebook request paths in same controller iOS SDK
I am having a controller where I need 开发者_Python百科issue multiple facebook requests. How do I tell the request appart in this delegate method?
- (void)request:(FBRequest *)request didLoad:(id)result { ... }
I need to do one thing for one request and another thing for the other request.
How about write individual class request & results from delegates , i used to try this when in Single View i need to take Friends List, Checkins Data , User Info.
i ll create three separate delegate results & get results back .
However making multiple requests will work but it will create bad performances when any one of the requests failed or goes wrong.
Hope it helps
Updated :
userInfo *uInfo = [UserInfo alloc]init];
[uinfo getuserDetails];
[uInfo release];
create a protocol to return results of user info back to view class like In UsuerInfo class
-(void)request:(FBRequest *)request didLoad:(id)result {
[delegate finfinishedGettingUserInfoDetails:result] // convert to array
}
IN your view class get back the results as
-(void)finishedGettingUserInfoDetails : (NSMutableArray *)userArr {
yourInstanceArray = [userArr copy];
}
do this for all multiple requests.
精彩评论