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.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Before this method is invoked,
NO; after, it returns
For efficiency, newly created
NSInvocation objects don’t retain or copy their arguments, nor do they retain their targets, copy C strings, or copy any associated blocks. You should instruct an
NSInvocation object to retain its arguments if you intend to cache it, because the arguments may otherwise be released before the invocation is invoked.
NSTimer objects always instruct their invocations to retain their arguments, for example, because there’s usually a delay before a timer fires.