Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights Reserved.

NSMethodSignature

Inherits From: NSObject

Conforms To: NSObject (NSObject)

Declared In: Foundation/NSMethodSignature.h

Class Description

NSMethodSignature provides the programmatic interface to objects that provide access to the type signatures of an object's methodsthat is, the types of the arguments and return value. A method signature is used by the distributed objects machinery to determine how to correctly encode method names and arguments for the underlying inter-process communications. The typical use of method signatures is when a message is sent to a remote object via a proxy. If the proxy doesn't know the types of arguments a remote object will use, the proxy first has to query the remote object for its method signature object, which specifies the types the method requires as arguments. The proxy then knows how to encode the data it has been passed and forward it correctly to the real object.

You create a method signature object by sending a signatureWithObjCTypes method to the NSMethodSignature class object, passing a C-style character string which specifies the method's return types and argument types.

Given a method signature, all other available instance methods query the object for information about the signature, such as its return type, number of arguments, stack frame size (obviously architecture-dependent), and so on.

Also see NSInvocation for the class which can use method signature objects to send messages to other objects.

Creating a Method Signature

Querying a Method Signature