I have looked at various answers on SO for this but can't quite get my head around how it all actually works.
What I have is a GameEngine that contains touchable elements, what I want is for when an element is touched it fires off a "I have been touched" event that the GameEngine listens for and deals with appropriately.
In C# I'd do this with delegates/events but can't seem to find a decent obj c equivalent that uses blocks. - I want to use Blocks as it more akin to anonymous functions in C# which I am used to.
In C# I'd simply do something like the following, in objective c it seems I need to write a page of code to get the same thing working?
touchableObject.touched += (o) => { handler code yay }
Edit based on Driis' answer:
Declaration
typedef void (^CircleTouchedHandler)(id parameter);
@interface CircleView : UIView{
}
@property CircleTouchedHandler Touched;
How to call it and pass myself as a parameter?
[self Touched(self)]; // this doesnt work