面向方面的Objective-C库?

问题描述:

我是否有可用于iPhone开发的面向方面的Objective-C库?

Is there any Aspect-Oriented Objective-C library that I could perhaps use for iPhone development?

有一个一个名为 AspectCocoa 的旧项目,这可能就是您要搜索的内容。

There is an old project called AspectCocoa, this might be what you are searching for.

否则Í会建议你自己滚动。基于代理的AOP通过继承 NSProxy 进行更改。或者你可以使用非常酷的Obj-C运行时函数来调整方法 method_exchangeImplementations()

Otherwise Í would suggest rolling your own. Either proxy based AOP by subclassing NSProxy for a change. Or you could do some method swizzling with the quite cool Obj-C run-time function method_exchangeImplementations().

但除非你正在寻找一个有趣的练习,否则问问自己你想要达到什么目标,以及是否存在完全可行的Objective-C方法。

But unless you are looking for a fun exercise, ask yourself what you want to achieve, and if there is an existing perfectly working Objective-C way to do it.