Anonymous delegate implementation in Objective-C?
问题 Is it possible to declare anonymous implementations of things like Delegates in Objective-C. I think I have the terminology right, but here's a java example: myClass.addListener(new FancyInterfaceListener({ void onListenerInterestingAction(Action a){ ....interesting stuff here } }); So for example to handle an UIActionSheet call I have to declare another method in the same class, which seems a bit silly if I want to pass it data, because I'd have to store that data as a global variable. Here