imp_implementationWithBlock()takes a block as a parameter, copies it to the heap, and returns a trampoline that allows the block to be used as the implementation — the
IMP— of a method in any Objective-C class (as long as the block’s arguments and the method’s arguments are compatible).
Most code will never need this, but in rare cases it will be incredibly useful. Currently iOS-only, unfortunately.
Stay up-to-date by subscribing to the Comments RSS Feed for this post.