This is the entire view controller. I put a * on the line that's failing.

using System;
using System.Drawing;
using System.Threading;

using MonoTouch.Foundation;
using MonoTouch.UIKit;

using Xception.iPhone.UI;

namespace KleverLogic.FlashValet.iPhone.Valet
{
    public class UpdatePhoneViewController : BaseViewController
    {
        private UILabel label;
        private UILabel phoneNumberLabel;
        private UITextField phoneNumber;
        private MOGlassButton updatePhoneButton;

        public UpdatePhoneViewController()
        {
        }

        public UpdatePhoneViewController(System.IntPtr handle)
            : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            try
            {
                base.ViewDidLoad();

                Title = "Phone Number";

                this.label = this.AddLabel("If you know the phone number of 
this iPhone, please enther it here. If not, it can be entered later on the 
Settings Screen in the Control Tab.");

                this.phoneNumber = this.AddLabelAndTextField("Phone Number", 
"Enter the phone number", UIKeyboardType.NumberPad, out this.phoneNumberLabel);
                this.updatePhoneButton = this.AddFullButtonLarge("Continue");

                this.updatePhoneButton.Clicked += 
HandleUpdatePhoneButtonClicked;
            }
            catch (Exception ex)
            {
                Application.SendError(ex);
            }
        }

        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (this.label != null)
                {
                    this.label.Dispose();
                    this.label = null;
                }

                if (this.phoneNumberLabel != null)
                {
                    this.phoneNumberLabel.Dispose();
                    this.phoneNumberLabel = null;
                }

                if (this.phoneNumber != null)
                {
                    this.phoneNumber.Dispose();
                    this.phoneNumber = null;
                }

                if (this.updatePhoneButton != null)
                {
                    this.updatePhoneButton.Dispose();
                    this.updatePhoneButton = null;
                }
            }
        }

        void HandleUpdatePhoneButtonClicked(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.phoneNumber.Text))
                {
*                 this.NavigationController.NavigationBarHidden = true;
                    
this.MyNavigationController.SetRootViewController(Application.DispatchViewController,
 true);
                    return;
                }

                if (this.phoneNumber.Text.Length != 10)
                {
                    BaseViewController.ShowAlert("Please enter a 10 digit phone 
number.");

                    this.phoneNumber.BecomeFirstResponder();
                    return;
                }

                Common.SettingsViewController.Settings settings = 
AppDelegate.Settings;
                settings.PhoneNumber = this.phoneNumber.Text;
                AppDelegate.SaveSettings(); //AppDelegate.Settings = settings;

                BaseViewController.ShowModalAlert("Updating Phone Number");

                new Thread(this.CompleteHandleUpdatePhoneButtonClicked).Start();
            }
            catch (Exception ex)
            {
                BaseViewController.HideModalAlert();
                Application.SendError(ex);
            }
        }

        void CompleteHandleUpdatePhoneButtonClicked()
        {
            using (NSAutoreleasePool pool = new NSAutoreleasePool())
            {
                try
                {
                    BaseViewController.HideModalAlert();

                    this.InvokeOnMainThread(delegate
                    {
                        this.NavigationController.NavigationBarHidden = true;
                        
this.MyNavigationController.SetRootViewController(Application.DispatchViewController,
 true);
                    });
                }
                catch (Exception ex)
                {
                    BaseViewController.HideModalAlert();
                    Application.SendError(ex);
                }
            }
        }
    }
}


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of catullum
Sent: Saturday, August 27, 2011 11:48 AM
To: [email protected]
Subject: Re: [MonoTouch] How do I fix this?

sorry this is to less,
post the class portion 
i think to know the problem but i need more infos.


--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/How-do-I-fix-this-tp3772103p3773276.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to