Changeset 152
- Timestamp:
- 11/02/08 17:46:03 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
open-source/NMInvocationBuilder/trunk/DelegateCallerTest.m
r147 r152 40 40 } 41 41 42 43 // TODO: tink about object lifetimes and object ownership44 42 @end open-source/NMInvocationBuilder/trunk/NMDelegateCaller.m
r151 r152 7 7 #import "NMDelegateCaller.h" 8 8 9 //@interface NSObject (DelegateMethodNotSupportedMarker)10 //- (void) NMDelegateCaller_delegateDoesNotSupportThisMessage;11 //@end12 13 9 @implementation NSObject (DelegateMethodNotSupportedMarker) 14 10 - (void) NMDelegateCaller_delegateDoesNotSupportThisMessage; {} 11 @end 12 13 // Not implemented, just here to supress a warning, that can't be switched off otherwise. :/ 14 @interface NMInvocationBuilder (CompilerPacifier) 15 - (void) dealloc; 15 16 @end 16 17 open-source/NMInvocationBuilder/trunk/NMInvocationBuilder.h
r147 r152 10 10 #import <Cocoa/Cocoa.h> 11 11 #import <objc/objc-class.h> // needed for Class 12 13 #pragma mark Public Interface 14 /*! 15 This is what it's all about. Use it like this: 16 17 id invocation = NMCatchInvocation(@"fnord", stringByAppendingString:@"23"); 18 [invocation invoke]; 19 id returnValue = nil; 20 [invocation getReturnValue:&returnValue]; 21 */ 22 #define NMCatchInvocation(anObject, aCall) ({ \ 23 id __builder = NMMakeInvocationBuilderOnStack(anObject); \ 24 [__builder aCall]; \ 25 [NMInvocationBuilder invocationFromInstance:__builder]; \ 26 }) 27 28 12 29 13 30 /// Root class so it inherits no methods and can capture more … … 31 48 - (NSMethodSignature *) methodSignatureForSelector:(SEL)aSelector; 32 49 - (void) forwardInvocation:(NSInvocation *)invocation; 33 - (void) dealloc;34 50 35 51 @end … … 50 66 51 67 52 #pragma mark Public Interface53 /*!54 This is what it's all about. Use it like this:55 56 id invocation = NMCatchInvocation(@"fnord", stringByAppendingString:@"23");57 [invocation invoke];58 id returnValue = nil;59 [invocation getReturnValue:&returnValue];60 */61 #define NMCatchInvocation(anObject, aCall) ({ \62 id __builder = NMMakeInvocationBuilderOnStack(anObject); \63 [__builder aCall]; \64 [NMInvocationBuilder invocationFromInstance:__builder]; \65 })
