2
votes

I started a new MonoTouch project. I opened the Interface Builder and created a button and outlet. I hooked up the button to the outlet. I saved the XIB then went back to MonoDevelop and attempted to build the project. I am getting errors in the generated XIB Designer file. The errors are:

Error CS1502: The best overloaded method match for `MonoTouch.Foundation.NSObject.SetNativeField(string, MonoTouch.Foundation.NSObject)' has some invalid arguments (CS1502) (Test2)
Error CS1503: Argument `#2' cannot convert `object' expression to type `MonoTouch.Foundation.NSObject' (CS1503) (Test2)

This is the property is created:

#pragma warning disable 0169
    [MonoTouch.Foundation.Connect("window")]
    private object window {
        get {
            this.__mt_window = ((object)(this.GetNativeField("window")));
            return this.__mt_window;
        }
        set {
            this.__mt_window = value;
            this.SetNativeField("window", value);
        }
    }

Any ideas?

1
Can you post your XIB layout screenshot? - Dan Abramov
If I create a new project, the build, it works. If I open the XIB (in Interface Builder), do not change anything and click save, then build, it fails. My XIB has nothing in it besides the default window. - user472292
Are you using the most recent software versions? - Dan Abramov
That was it. Can you post this as an answer and I will give you credit? - user472292

1 Answers

1
votes

Make sure you're using the most recent (and matching) versions of the tools.
For example, MonoTouch installation page lists the following requirements for the most recent version: