# NSMethodSignature class reference

mccallum@gnu.ai.mit.edu
Generated at 2025-02-13 06:02:40 +0000
1994-2015 Free Software Foundation, Inc.
Software documentation for the NSMethodSignature class
Foundation/NSMethodSignature.h

Class encapsulating type information for method arguments and return value. It is used as a component of NSInvocation to implement message forwarding, such as within the distributed objects framework. Instances can be obtained from the NSObject method [NSObject -methodSignatureForSelector:].

Basically, types are represented as Objective-C `@encode(...)` compatible strings. The arguments are numbered starting from 0, including the implicit arguments `self` (type `id`, at position 0) and `_cmd` (type `SEL`, at position 1).

signatureWithObjCTypes:
t
Build a method signature directly from string description of return type and argument types, using the Objective-C `@encode(...)` type codes.
frameLength
Number of bytes that the full set of arguments occupies on the stack, which is platform(hardware)-dependent.
getArgumentTypeAtIndex:
index
Returns Objective-C `@encode(...)` compatible string. Arguments are numbered starting from 0, including the implicit arguments `self` (type `id`, at position 0) and `_cmd` (type `SEL`, at position 1).
Type strings may include leading type qualifiers.
isOneway
Pertains to distributed objects; method is asynchronous when invoked and return should not be waited for.
methodReturnLength
Number of bytes that the return value occupies on the stack, which is platform(hardware)-dependent.
methodReturnType
Returns an Objective-C `@encode(...)` compatible string describing the return type of the method. This may include type qualifiers.
numberOfArguments
Returns number of arguments to method, including the implicit `self` and `_cmd`.