I could be wrong, but, I don't think the UIButton declaration is necessary . The click event is registered with the RowSelected override. No need to cast a button in addition to that.
On Mon, Sep 26, 2011 at 7:37 AM, Andreas Ploetzeneder < [email protected]> wrote: > Hello, > > Why does my UITableCellView Crash when i press the button? > > TouchUpInside > > > Error: > > Stacktrace: > > at (wrapper managed-to-native) > MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) > <IL 0x0009f, 0xffffffff> > > at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00042] > in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29 > > at Siemens3G.Application.Main (string[]) [0x00000] in > /Users/ploetzi/Projects/Siemens3G/Siemens3G/Main.cs:16 > > at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object > (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff> > > > Best regards > > > public ServerCell () : base ("ServerCell", null) > > { > > MonoTouch.Foundation.NSBundle.MainBundle.LoadNib ("ServerCell", this, > null); > > Initialize (); > > } > > void Initialize () > > { > > } > > public UITableViewCell Cell{ > > get{return cell; > > } > > } > > public void Loaddata () > > { > > System.Diagnostics.Debug.WriteLine("LoadData"); > > Buttonrund.TouchUpInside+=HandleButtonTouchUpInside; > > base.ViewDidLoad (); > > } > > void HandleButtonTouchUpInside (object sender, EventArgs e) > > { > > var button = sender as UIButton; > > Console.WriteLine("{0} touched", > button.Title(UIControlState.Normal)); > > } > > > > > > _______________________________________________ > MonoTouch mailing list > [email protected] > http://lists.ximian.com/mailman/listinfo/monotouch > >
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
