People are really loving those Objective-C blocks. Right now, when I port some code I find for cocos2d-iphone that has them, I make a class to act as a functor (+ reference holder for referenced objects) — but this is often a pain. Not to mention it’s a pain to make sure that object stays around until it’s no longer needed.
Does anyone have any tricks/suggestions/pointers to make this easier in general?
[ Functor = Function Object = https://en.wikipedia.org/wiki/Function_object ]