Search code examples
iphoneobjective-ciosaop

Aspect-Oriented Objective-C Library?


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


Solution

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

    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().

    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.