You can try the approach recommended here:
http://ioscodesnippet.com/post/43288248813/method-swizzling-in-objective-c
Basically, you can add tracing to a specific method, which, as you know, you want to track in advance, choosing a real implementation for your custom implementation that registers a trace instruction before calling the real implementation (in this case, you can override - [UIButton endTrackingWithTouch: withEvent:]).
source share