After searching for this type of error:
Variable is not assignable (missing __block type specifier)
I found the following solution Assign a variable inside a Block to a variable outside a Block and after I read about the __block I could not benefit from the accepted answer and my code is different scenario.
Here is the code that I am using:
NSDictionary *strongUser = [[NSDictionary alloc]init];
__block NSDictionary *user = strongUser;
NSMutableDictionary* parameters = [NSMutableDictionary dictionary];
[parameters setValue:@"id, name, email" forKey:@"fields"];
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:parameters]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
user = result;
}];
NSLog(@"%@",user);
NSLog
print nothing
What I want is to given the result value to extern variable outside the block.