I looked around, but couldn\'t find this on the internet, nor anywhere in the Apple docs, so I\'m guessing it doesn\'t exist.
But is there a iOS4 blocks equivalent A
There is REKit which brings out Blocks latent ability. It gives you ability to add/override method to a instance using Block.
With REKit, you can dynamically make a target - which responds to buttonAction - like below:
id target;
target = [[NSObject alloc] init];
[target respondsToSelector:@selector(buttonAction) withKey:nil usingBlock:^(id receiver) {
// Do something…
}];
[button addTarget:target action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
You don't need to make a subclass nor a category.
In addition to target/action paradigm, you can use REKit for delegation pattern.