Instance Method


Sets an argument of the receiver.


- (void)setArgument:(void *)argumentLocation atIndex:(NSInteger)idx;



An untyped buffer containing an argument to be assigned to the receiver. See the discussion below relating to argument values that are objects.


An integer specifying the index of the argument.

Indices 0 and 1 indicate the hidden arguments self and _cmd, respectively; you should set these values directly with the target and selector properties. Use indices 2 and greater for the arguments normally passed in a message.


This method copies the contents of buffer as the argument at index. The number of bytes copied is determined by the argument size.

When the argument value is an object, pass a pointer to the variable (or memory) from which the object should be copied:

NSArray *anArray;
[invocation setArgument:&anArray atIndex:3];

This method raises NSInvalidArgumentException if the value of index is greater than the actual number of arguments for the selector.

See Also

Configuring an Invocation Object


The receiver’s selector, or 0 if it hasn’t been set.


The receiver’s target, or nil if the receiver has no target.

- getArgument:atIndex:

Returns by indirection the receiver's argument at a specified index.


YES if the receiver has retained its arguments, NO otherwise.

- retainArguments

If the receiver hasn’t already done so, retains the target and all object arguments of the receiver and copies all of its C-string arguments and blocks. If a returnvalue has been set, this is also retained or copied.

- setReturnValue:

Sets the receiver’s return value.

- getReturnValue:

Gets the receiver's return value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software