I am working with the iOS Facebook SDK 3 and I am trying to use it with a more efficient approach. Therefore, I would like to manage some requests in separate threads.
For example, this query (WORKS PERFECTLY):
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); dispatch_async(queue, ^{ [self generateShareContentFor:ShareServiceTypeFacebook callback:^(NSMutableDictionary* obj) { FBRequest * rq = [FBRequest requestWithGraphPath:@"me/feed" parameters:obj HTTPMethod:@"POST"]; [rq startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{
I use this to publish something in my channel, I call a method to load the contents of this request automatically, and then this method will be called in the request start method. It works well.
The problem is that I do not put this request in a block that does not work.
This request does not work
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); dispatch_async(queue, ^{ FBRequest * rq = [FBRequest requestForMe]; [rq startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{
I am trying to find out, but I do not understand what the problem is. Thanks in advance for your help.
source share