Reputation: 329
I am trying to run the following code with MonoTouch:
this.TouchesBegan += delegate { txtAmount.ResignFirstResponder(); };
When I compile I get the following error:
Cannot assign to `TouchesBegan' because it is a `method group'
The API seems to support this: http://docs.xamarin.com/ios/advanced_topics/api_design
Any ideas?
Upvotes: 4
Views: 3020
Reputation: 43553
I guess you're using UIGestureRecognizer
right ?
If so then `TouchesBegan' is a method not an event so you cannot assign a delegate to it.
public virtual void TouchesBegan (NSSet touches, UIEvent evt)
You might want to look at:
public UITouchEventArgs ShouldReceiveTouch;
public UIGesturesProbe ShouldRecognizeSimultaneously;
public UIGestureProbe ShouldBegin;
and the Touches_GestureRecognizers sample.
Upvotes: 3