How to call an objective-c function which accepts Dictionary of blocks as argument from Swift?
问题 I have a function in my objective c file (lets say class MyBlockExecutor): + (void) runBlockFromDictionary: (NSDictionary*) blocksDict andKey: (NSString*) key { if ( [blocksDict objectForKey: key] != nil ) { ((MyBlock)[blocksDict objectForKey: key])(); } } Now, I want to call this function from Swift. Here is my swift call: MyBlockExecutor.runBlock(from: [ "key1":{ ()->Void in print("block for key1 called") } ], andKey: "key1") This crashes my app. I am getting EXC_BAD_ACCESS error on this