简体   繁体   中英

How to know which request a FB Graph's response respond to?

I make a call to FB graph api using FB IOS and handle the response in a delegate object which conforms to FBRequestDelegate. The handle functions is

- (void)request:(FBRequest *)request didLoad:(id)result;

My question is that how do I know which request this response respond to if two requests with same graph path are made?

Look into FBRequest

@interface FBRequest : NSObject {
    id<FBRequestDelegate> _delegate;
    NSString*             _url;
    NSString*             _httpMethod;
    NSMutableDictionary*  _params;
    NSURLConnection*      _connection;
    NSMutableData*        _responseText;
    FBRequestState        _state;
    NSError*              _error;
    BOOL                  _sessionDidExpire;
}

is there any of these instance variable can be used to distinguish between requests with same graph path?

Thanks

you can check the request url .. im currently dealing with it like this .. for example

 if([request.url rangeOfString:@"me/feed"].location !=NSNotFound)
{
   //Do something
}
else if([request.url rangeOfString:@"fql.query"].location !=NSNotFound)
{
   //Do something
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM