I’m new in xamarin ios and I need to add view in existing project. Project use mvvmcross framework. I’ve done:
Created PerevozkiViewModelClass :MvxViewModel in Core project
Add UI View controller with storydoard (P.S. BaseView extends MvxViewController)
public partial class PerevozkiView : BaseView { public PerevozkiView() : base("PerevozkiView", null) { }
public override void ViewDidLoad() { base.ViewDidLoad(); var set = this.CreateBindingSet<PerevozkiView, PerevozkiViewModel>(); set.Apply(); } }
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)
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