steipete / Aspects

Delightful, simple library for aspect oriented programming in Objective-C and Swift.
https://twitter.com/steipete
MIT License
8.4k stars 1.26k forks source link

Problem with NSProxy subclasses #35

Open iamredeye opened 9 years ago

iamredeye commented 9 years ago

Hi there,

I have an application with a class named DynamicUIWebViewDelegate that I want to put hooks on some methods of it. The problem is that class is a subclass of NSProxy so when I add the hooker I have an exception at runtime :

[DynamicUIWebViewDelegate aspect_hookSelector:withOptions:usingBlock:error:]: unrecognized selector sent to class

How could I react to solve this issue ?

Thanks Peter

steipete commented 9 years ago

That might be hard; as we use runtime forwarding internally as well. does it work on the 1.5 branch?

iamredeye commented 9 years ago

Nope.

steipete commented 9 years ago

Not having any plans to add special code, but if you find an elegant solution, I'm curious.