Article:
  Higher-Order Messages in Cocoa
Subject:   Let HOM be your mantra
Date:   2005-06-23 01:17:49
From:   DanD.
Response to: Let HOM be your mantra

dang it, I meant


[superHeros makeObjectsPerformSelector:@selector(saveTheDay)];


etc. Sorry for not proofreading.


-Dan

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Let HOM be your mantra
    2005-06-23 16:40:08  georgerix [View]

    (I'm posting from my Dad's account for the moment--apologies for any confusion this causes.)

    There really is no problem with makeObjectsPerformSelector:; it's a handy mechanism to have when you need to perform an operation over an array. However, it doesn't yield the full flexibility of a mechanism such as blocks or trampolines, whereby you can define methods (like collect, select, reject, and detect) which return (and in the case of detect, operate) differently.

    makeObjectsPerformSelector: is more or less equivalent, when combined with its siblings which take further arguments to use, to the HOM method do, but more complex uses require invocations... trampolines and HOM are basically a system to make invocations automatically-- that is, to make them conveniently.

    As much as anything else, it's a matter of style.

    Thanks for the comments!