Maybe a simple question but I can’t seem to get it. I want to get the users profile picture but also want search his/her posts. Like this:
[facebook requestWithGraphPath:@"me/picture?type=large" andDelegate:self];
[facebook requestWithGraphPath:@"me/home?q=TEST" andDelegate:self];
I can get the picute out with the following code:
- (void)request:(FBRequest*)request didLoad:(id)result{
if ([result isKindOfClass:[NSData class]])
{
UIImage *image = [[UIImage alloc] initWithData:result];
UIImageView *profilePicture = [[UIImageView alloc] initWithImage:image];
[image release];
profilePicture.frame = CGRectMake(20, 20, 80, 80);
[self.view addSubview:profilePicture];
[profilePicture release];
}
}
But I don’t know how i can get the search query data out.
Any help would be great! Thnx
requestWithGraphPath:andDelegate:returns a pointer to an object of typeFBRequest. Save it and use it later to differentiate between requests inrequest:didLoad:comparing it against the first parameter passed to this method.For example, you can have two properties to hold the request objects. Although, if you are going to deal with many requests, you can use a container like
NSDictionaryinstead.And then in
request:didLoad::