Xamarin ios: loaded the nib but the view outlet was not set

131 Views Asked by At

I’m new in xamarin ios and I need to add view in existing project. Project use mvvmcross framework. I’ve done:

  1. Created PerevozkiViewModelClass :MvxViewModel in Core project

  2. Add UI View controller with storydoard (P.S. BaseView extends MvxViewController)enter image description here

    public partial class PerevozkiView : BaseView { public PerevozkiView() : base("PerevozkiView", null) { }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
    
            var set = this.CreateBindingSet<PerevozkiView, PerevozkiViewModel>();
            set.Apply();
        }
    
    }
    
  3. Delete PerevozkiView.Storyboard

4.Add PerevozkiView.xib and in file owner specify PerevozkiView (I cant choose it from list, so I just hardcode “PerevozkiView as file owner)enter image description here

  1. After deploy in IOS simulator I’ve got exception: Foundation.MonoTouchException Сообщение = Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: -[UIViewController _loadViewFromNibNamed:bundle:] loaded the "PerevozkiView" nib but the view outlet was not set here in Main:

     public class Application
        {
            // This is the main entry point of the application.
            static void Main(string[] args)
            {
                // if you want to use a different Application Delegate class from "AppDelegate"
                // you can specify it here.
                UIApplication.Main(args, null, "AppDelegate");
            }
        }
    

I have no idea what is wrong. Pls help

0

There are 0 best solutions below