This is NSInvocation.rtf in view mode; [Download] [Up]
paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc. All Rights Reserved. s4 li100 fi0 ri1007 ql f0 b fs36 fs100 fs36 NSInvocation pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject fs20 fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding fi0 NSObject (NSObject) fs20 fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 Foundation/NSInvocation.h fs20 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 Objects of the NSInvocation class provide a system-independent means to construct message calls to other objects. An NSInvocation object constructs a i targeti0 object to which a message can be sent, a i selectori0 for that method, an i argument listi0 for the selector, and a return value. NSInvocation objects provide great flexibility in that the methods, method arguments, and targets of the methods may be constructed dynamically. fs16 fs28 The final sending of the message to the target object can be performed at any time, independent of constructing the invocation. For example, methods could be dispatched based on timer events. In addition, return values from the methods are stored in the NSInvocation object and can be retrieved at any later stage in processing. fs16 fs28 Also see NSMethodSignature for a description of how to construct method signatures. fs16 fs28 The b fs28 Foundation/NSInvocation.hb0 fs28 header file defines two macros that may be used as constructors for invocations: fs16 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 b NSInvocation *invocation =b0 b NS_MESSAGE(b0 i targetb i0 ,b0 i messageb i0 )b0 tab tab s9 li7030 fi-6553 fi-5796 tab builds an invocation containing a i messagei0 to a known i targeti0 object. i targeti0 is an object id. i messagei0 consists of a selector followed by any arguments, just like an Objective-C message. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 b NSInvocation *invocation = NS_INVOCATION(b0 i classb i0 ,b0 i messageb i0 )b0 tab s9 li7030 fi-6553 fi-5796 tab builds an invocation containing a i messagei0 to the untargeted class object i classi0 .b b0 i messagei0 consists of a selector followed by any arguments, just like an Objective-C message. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Creating Invocations fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSInvocation *)b invocationWithMethodSignature:b0 (NSMethodSignature *)i sig s9 li7030 fi-6553 fi-5796 i0 tab Returns an invocation object able to construct calls to objects using method selectors with type signatures described by i sigi0 . Raises NSInvalidArgumentException if i sigi0 is b nilb0 . pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Managing Invocation Arguments fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (BOOL)b argumentsRetainedb0 tab Returns YES if arguments are retained. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b getArgument:b0 (void *)i argumentLocationi0 tab Copies the argument stored at i indexi0 into the storage s9 li7030 fi-6553 fi-5796 b atIndex:b0 (int)i indextab i0 tab pointed to byi argumentLocationi0 where 2 is the index of the first argument, 3 is the index of the second, and so on. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 tab fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b getReturnValue:b0 (void *)i retLoci0 tab Copies the invocation'27s return value into the storage pointed to by i retLoci0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (NSMethodSignature *)b methodSignatureb0 tab Returns the invocation'27s method signature object. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b retainArgumentsb0 tab By default, target and arguments are not retained, and C strings are not copied. This method instructs the invocation to retain its arguments, target, and make copies of C strings. This method is invoked automatically by timers. This method should be invoked whenever the dynamic scope of the invocation can exceed its arguments. fi-6552 fs16 fs28 fi-6552 {f3 -} (SEL)b selectorb0 tab Returns the invocation'27s selector. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setArgument:b0 (void *)i argumentLocationi0 tab Sets the argument stored at i indexi0 to the storage pointed to s9 li7030 fi-6553 fi-5796 b atIndex:b0 (int)i indexi0 tab tab byi argumentLocationi0 where 2 is the index of the first argument, 3 is the index of the second, and so on.. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setReturnValue:b0 (void *)i retLoci0 tab Sets the invocation'27s return value to that indicated by i retLoci0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setSelector:b0 (SEL)i selectori0 tab Sets the invocation'27s selector to i selectori0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setTarget:b0 (id)i targeti0 tab Sets the invocation'27s target to i targeti0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (id)b targetb0 tab Returns the invocation'27s target; returns b nilb0 if there is no target. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Dispatching an Invocation fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b invokeb0 tab Causes the message encoded in the invocation to be dispatched to its target. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b invokeWithTarget:b0 (id)i targeti0 tab Causes the message encoded in the invocation to be dispatched to i targeti0 . }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.