I have my own method that takes a block as an argument. I want to keep track of that block inside an NSDictionary. What is the best way to add the block to the dictionary?>
If you are using ARC, use -copy:
-copy
void (^handlerCopy)(NSURLResponse*, NSData*, NSError*) = [handler copy]; [dict setObject:handlerCopy forKey:@"foo"];