I try to use NSProxy to wrap object and make an proxy instance in (forwardInvocation:) as invocation' retValue, but all proxyon instance from can't be release in ARC. I've been troubled for a long time.
demo at github:https://github.com/JorrisRaghan/proxyon
you can see console log:
DEALLOC PPObject:...
DEALLOC Proxyon:Class< PPObject >
but without DEALLOC Proxyon:id< PPObject >".
you also can use Instruments to check memory leak.
so I need your help to solve it, thank you!
Update: I found that this leak is from forwardInvocation:
void *proxyon = (__bridge_retained void *)[Proxyon proxyonWithInstance:obj];
[anInvocation setReturnValue:&proxyon];
I set PPObject as retVal instead of Proxyon instance, and leak happened in PPObject, so I guess -[NSInvocation setReturnValue:] is the key.But how to solve it?