Source/AIScannerDebug.m
branchadium-1.5.10.5
changeset 6003 6e8c6761ee0d
parent 3679 f4294bb53b0f
equal deleted inserted replaced
6002:66aac3254a5d 6003:6e8c6761ee0d
    25 	method_exchangeImplementations(class_getClassMethod(self, @selector(scannerWithString:)), class_getClassMethod([NSScanner class], @selector(scannerWithString:)));
    25 	method_exchangeImplementations(class_getClassMethod(self, @selector(scannerWithString:)), class_getClassMethod([NSScanner class], @selector(scannerWithString:)));
    26 	method_exchangeImplementations(class_getInstanceMethod(self, @selector(initWithString:)), class_getInstanceMethod([NSScanner class], @selector(initWithString:)));
    26 	method_exchangeImplementations(class_getInstanceMethod(self, @selector(initWithString:)), class_getInstanceMethod([NSScanner class], @selector(initWithString:)));
    27 }
    27 }
    28 
    28 
    29 //These will be exchanged with the ones in NSScanner, so to get the originals we need to call the AIScannerDebug ones
    29 //These will be exchanged with the ones in NSScanner, so to get the originals we need to call the AIScannerDebug ones
    30 + (id)scannerWithString:(NSString *)aString
    30 + (instancetype)scannerWithString:(NSString *)aString
    31 {
    31 {
    32 	NSParameterAssert(aString != nil);
    32 	NSParameterAssert(aString != nil);
    33 	return method_invoke(self, class_getClassMethod([AIScannerDebug class], @selector(scannerWithString:)), aString);
    33     
       
    34     static id (*_scannerWithString_method_invoke)(id, Method, NSString *) = (id (*)(id, Method, NSString *)) method_invoke;
       
    35 	return _scannerWithString_method_invoke(self, class_getClassMethod([AIScannerDebug class], @selector(scannerWithString:)), aString);
    34 }
    36 }
    35 
    37 
    36 - (id)initWithString:(NSString *)aString
    38 - (instancetype)initWithString:(NSString *)aString
    37 {
    39 {
    38 	NSParameterAssert(aString != nil);
    40 	NSParameterAssert(aString != nil);
    39 	return method_invoke(self, class_getInstanceMethod([AIScannerDebug class], @selector(initWithString:)), aString);
    41     
       
    42     static id (*_initWithString_method_invoke)(id, Method, NSString *) = (id (*)(id, Method, NSString *)) method_invoke;
       
    43 	return _initWithString_method_invoke(self, class_getInstanceMethod([AIScannerDebug class], @selector(initWithString:)), aString);
    40 }
    44 }
    41 
    45 
    42 @end
    46 @end
    43 
    47 
    44 #endif
    48 #endif