Take the 2-minute tour ×  I am using Facebook SDK 3 which uses
Blocks as CompletionHandlers. I want to use a local scope
variable (Argument) in the passing block to FBRequestConnection
-(void)     shareStoryWithHandle:(const int)HID
parameters:(NSString*)jsonparams     if
(FBSession.activeSession.isOpen)          FBRequestHandler
my_handler = ^(FBRequestConnection *connection, id result,
NSError *error)             // do somthing with HID
// but HID is 0 in this scope while is correct in
shareStoryWithHandle scope!         [FBRequestConnection
startWithGraphPath:@"me/feed"
parameters:[jsonparams objectFromJSONString]  How can i use HID
in the Block scope, and i cant store it in the class!
share|improve this question add comment  1 Answer  Your
assertion that HID is 0 in the block is wrong. When you create
the block it takes a const copy of any captured variables, so if
you reference HID in the block then the variable in the block
will have the value that HID did