Well, all your answers use a lot of unnecessary code that is terribly outdated and no longer works.
I found one answer myself, although I adapted and got this:
[myButton addTarget:[^{NSLog(@"Pressed the button");} copy] action:@selector(invoke) forControlEvents:UIControlEventTouchUpInside];
Which works great.
Chris source share