In MT 5.2.12 I'm getting exception "Failed to find selector handleTapFrom: on 
Test.TestViewController+OtherView". I have one UIView derived class which 
creates and adds tap gesture recognizer to itself in constructor. Then I have 
another class derived from previous one. Any tap on second view causes 
exception.

namespace Test
{
                public class TestViewController : UIViewController
                {
                                private OtherView _mainView;

                               private class MyView : UIView
                               {
                                               private UITapGestureRecognizer 
_recognizer;

                                               public MyView() { Initialize(); }

                                               public 
MyView(System.Drawing.RectangleF frame) : base(frame) { Initialize(); }

                                               private void Initialize()
                                               {
                                                               _recognizer = 
new UITapGestureRecognizer(this, new 
MonoTouch.ObjCRuntime.Selector("handleTapFrom:"));
                                                               
AddGestureRecognizer(_recognizer);
                                               }

                                               [Export("handleTapFrom:"), 
Preserve()]
                                               private void 
HandleTap(UITapGestureRecognizer recognizer)
                                               {
                                                               
Console.WriteLine("Tap");
                                               }
                               }

                               private class OtherView : MyView
                               {
                                               public OtherView() {}
                                               public 
OtherView(System.Drawing.RectangleF frame) : base(frame) {}
                               }
                               #endregion

                               #region Constructor
                               public TestViewController() {}

                                public override void LoadView()
                               {
                                               _mainView = new 
OtherView(UIScreen.MainScreen.ApplicationFrame);

                                               this.View = _mainView;
                               }
                }
}

Any idea why? Bug? The same works in obj-c.

Regards
Michal
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to