O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSInvocation — Mac OS X 10.0

Synopsis

This class encapsulates information about an Objective-C message such as the selector and the target of the message. NSInvocations are useful for statically storing a message and are often used with timers, and for message forwarding.

image with no caption

@interface NSInvocation : NSObject <NSCoding>
                                  // Convenience Constructors
   + (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)sig;
                                  // Accessor Methods
   - (void)setSelector:(SEL)selector;
   - (SEL)selector;
   - (void)setTarget:(id)target;
   - (id)target;
   - (void)setReturnValue:(void *)retLoc;
   - (void)setArgument:(void *)argumentLocation 
                                 atIndex:(int)index;
                                  // Instance Methods
   - (void)getReturnValue:(void *)retLoc;
   - (void)invoke;
   - (void)getArgument:(void *)argumentLocation 
                                 atIndex:(int)index;
   - (BOOL)argumentsRetained;
   - (void)invokeWithTarget:(id)target;
   - (NSMethodSignature *)methodSignature;
   - (void)retainArguments;
                                  // Methods Implementing NSCoding
   - (void)encodeWithCoder:(NSCoder *)aCoder;
   - (id)initWithCoder:(NSCoder *)aDecoder;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required