moszi/AOP-in-Objective-C — Issue #3: how to work with already constructed objects?
Author: andrei-shender
Created: 2012-02-24 11:08:54+00:00
State: open

NSMutableArray* testArray = [[AOPProxy alloc] initWithNewInstanceOfClass:[NSMutableArray class]];

[(AOPProxy*)testArray interceptMethodStartForSelector:@selector(addObject:)
withInterceptorTarget:self
interceptorSelector:@selector( addInterceptor: )];

How to add interceptor for objects constructed with Factory or objects that need other initializer than -(id)init ?