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

查看:32
本文介绍了面向方面的Objective-C 库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

否则 Í 会建议您自己滚动.通过子类化 NSProxy 进行更改,或者基于代理的 AOP.或者,您可以使用非常酷的 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天全站免登陆