Home > Articles > Home & Office Computing > Mac OS X

  • Print
  • + Share This
Like this article? We recommend

Conclusion

Higher-order messaging uses the second-chance dispatch mechanism in Objective-C, which isn't very fast, but is very flexible. In parts of programs where speed is not critical, or where the majority of the work is done inside the operation, it can dramatically simplify the code.

Higher-order messaging is certainly not the solution to every problem, but it's a very powerful technique. Once you've implemented a few methods that support higher-order messaging, you're likely to use it all over your code. As with anything else in Objective-C, it's a tradeoff between flexibility and speed. If you find that it's too slow after profiling, you can always replace it with something less general in the critical parts of your code.

  • + Share This
  • 🔖 Save To Your Account