Declared in NSInvocation+BlocksKit.h

Overview

BlocksKit extensions for NSInvocation.

Tasks

Class Methods

bk_invocationWithTarget:block:

+ (NSInvocation *)bk_invocationWithTarget:(id)target block:(void ( ^ ) ( id target ))block
Discussion

Generates a forwarding NSInvocation instance for a given method call encapsulated by the given block.

NSInvocation *invocation = [NSInvocation invocationWithTarget:target block:^(id myObject) {
    [myObject someMethodWithArg:42.0];
}];

This returns an invocation with the appropriate target, selector, and arguments without creating the buffers yourself. It is only recommended to call a method on the argument to the block only once. More complicated forwarding machinery can be accomplished by the A2DynamicDelegate family of classes included in BlocksKit.

Created by Jonathan Rentzch as NSInvocation-blocks.

Parameters

target

The object to “grab” the block invocation from.

block

A code block.

Return Value

A fully-prepared instance of NSInvocation ready to be invoked.

Declared In

NSInvocation+BlocksKit.h