[MonoTouch] trouble getting change a property of an outlet in a any new method

Salmo salmo at chb.com.br
Wed Dec 14 04:55:44 EST 2011


Hi,

I'm having trouble getting change a property of an 
outlet in a  any new method, for example:

        public partial class ViewApresentacao : UIViewController
	{
		...
                ...
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			//my ImageView 
			imgModelo.Image = UIImage.FromBundle ("Image/car.png");
		}
                
                //new method
		public void Test(string caminho)
		{
                        imgModelo.Image = UIImage.FromBundle (caminho);
		}
                ....
        }

At viewDidLoad functions normally, but the second 
method (Test) did not, wanted to use it 
to update when a selected row in a table, it's all 
ok but when I call the method "Test", the error 
"object reference not set to an instance of an object" 
appears well in line with the outlet.
Can someone help me?

Sorry if I was not very clear, I'm from Brazil and I'm 
using google translate!

Help pleaseee!!



More information about the MonoTouch mailing list