(callable, argIndex=-1)
return addClosure
Decorator for converting a function into an object that can be used
    as a callback function for (Objective-)C API's that take such a beast
    as one of their arguments.

    Note that using this decorator for methods is unsupported and that this
    decorator is optional when the callback isn't stored by the called function

    Usage::

        @objc.callbackFor(NSArray.sortedArrayUsingFunction_context_)
        def compare(left, right, context):
            return 1
Decorator for converting a function into an object that can be used
    as a callback function for (Objective-)C API's that take such a beast
    as one of their arguments.
Decorator for converting a function into an object that can be used as a callback function for ( Objective - ) C API s that take such a beast as one of their arguments .
def callbackFor(callable, argIndex=-1):
    """
    Decorator for converting a function into an object that can be used
    as a callback function for (Objective-)C API's that take such a beast
    as one of their arguments.

    Note that using this decorator for methods is unsupported and that this
    decorator is optional when the callback isn't stored by the called function

    Usage::

        @objc.callbackFor(NSArray.sortedArrayUsingFunction_context_)
        def compare(left, right, context):
            return 1
    """
    def addClosure(function):
        closure, meta = _makeClosure(function, callable, argIndex)
        function.pyobjc_closure = closure
        function.__metadata__ = lambda: meta
        return function

    return addClosure
def callbackFor ( callable , argIndex = - 1 ) : def addClosure ( function ) : closure , meta = _makeClosure ( function , callable , argIndex ) function . pyobjc_closure = closure function . __metadata__ = lambda : meta return function return addClosure