If two different classes have the same method, then which one will be called by the target C runtime system
eg:
@interface ClassA (MathOps) -(void)CategoryMethod; @end @interface ClassA (MathOps1) -(void)CategoryMethod; @end @implementation ClassA(MathOps1) - (void) CategoryMethod{ NSLog(@"Inside Category Method 2"); } @end @implementation ClassA(MathOps) - (void) CategoryMethod{ NSLog(@"Inside Category Method 1"); } @end
Now, if I call, [ObjClassA CategoryMethod] ;, then which one is called? Why?
@Dave DeLong, undefined. "", , . - , . . "" . , ( ), , . .
Cocoa, (, Cocoa) , , , . , , , :
@interface NSObject (MyCategory) - (void)myprefix_categoryMethod; @end
undefined. , , , .
: .:)