Creating an IMP from an Objective-C block
问题 The IMP type in Objective-C represents a function pointer, as far I as understand. Is there any way to make an IMP from a block pointer? Thanks for your ideas. 回答1: Since this was written there is now API in iOS and Mac OS X that allows Blocks to be turned into IMPs directly. I wrote up a weblog post describing the API (imp_implementationWithBlock()). A block is effectively a structure that contains a bit of metadata, a reference to the code contained within the block and a copy of the const