Changeset 152

Show
Ignore:
Timestamp:
11/02/08 17:46:03 (2 months ago)
Author:
mhaecker
Message:

moved some stuff around and added a test to check retain counts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • open-source/NMInvocationBuilder/trunk/DelegateCallerTest.m

    r147 r152  
    4040} 
    4141     
    42  
    43 // TODO: tink about object lifetimes and object ownership 
    4442@end 
  • open-source/NMInvocationBuilder/trunk/NMDelegateCaller.m

    r151 r152  
    77#import "NMDelegateCaller.h" 
    88 
    9 //@interface NSObject (DelegateMethodNotSupportedMarker) 
    10 //- (void) NMDelegateCaller_delegateDoesNotSupportThisMessage; 
    11 //@end 
    12  
    139@implementation NSObject (DelegateMethodNotSupportedMarker) 
    1410- (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; 
    1516@end 
    1617 
  • open-source/NMInvocationBuilder/trunk/NMInvocationBuilder.h

    r147 r152  
    1010#import <Cocoa/Cocoa.h> 
    1111#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 
    1229 
    1330/// Root class so it inherits no methods and can capture more 
     
    3148- (NSMethodSignature *) methodSignatureForSelector:(SEL)aSelector; 
    3249- (void) forwardInvocation:(NSInvocation *)invocation; 
    33 - (void) dealloc; 
    3450 
    3551@end 
     
    5066 
    5167 
    52 #pragma mark Public Interface 
    53 /*! 
    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 })