Hacker News new | ask | show | jobs
by jimbokun 5827 days ago
"Doesn't have any functional elements to it whatsoever."

There are methods like makeObjectsPerformSelector: and now methods for taking blocks.

Sending a selector is not functional, true, because it is an OO language, not a functional one. So the idea is "send this message to all these objects" instead of "call this function on all these objects."

Unfortunately, I don't see anyway to create a new collection from an existing one by sending each object a message (the equivalent of map). Furthermore, some methods actually do take C functions, and others take an NSPredicate. It would be more consistent if they had found a way to do all these things by sending selectors and a varargs list.

(It seems like blocks is the new, improved way to do all these things, and rather functional, but all the older ways still exist, so a developer must understand all of them.)

1 comments

Are blocks available in the iOS version of Objective-C? (Not trying to refute your point, just curious, since that would be exciting news for me if I do another iPhone app...
They're available in iOS4 natively, or can be used with earlier OSs with this project: http://code.google.com/p/plblocks/