面向方面的Objective-C库? [英] Aspect-Oriented Objective-C Library?

查看:108
本文介绍了面向方面的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.

这篇关于面向方面的Objective-C库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆