我是從以下斯圖爾特在MVVMCross iOS: how to bind a command with Custom transition when switching to different View modelMvvmCross的iOS:NullReference使用自定義演示者的視線
當我切換到使用從MvxModalNavSupportTouchViewPresenter然後我的應用程序崩潰(System.NullReferenceException導出我的自定義演示者的建議時:未將對象引用調用。開始()時設定爲在AppDelegate中:: FinishedLaunching一個對象的實例):
IMvxAppStart startup = Mvx.Resolve<IMvxAppStart>();
startup.Start();
調用棧是:
0x7 in Cirrious.MvvmCross.Touch.Views.Presenters.MvxTouchViewPresenter.get_CurrentTopViewController C#
0x2 in Cirrious.MvvmCross.Touch.Views.Presenters.MvxTouchViewPresenter.PresentModalViewController C#
0x4E in Cirrious.MvvmCross.Touch.Views.Presenters.MvxModalNavSupportTouchViewPresenter.Show C#
0xB in Cirrious.MvvmCross.Touch.Views.Presenters.MvxTouchViewPresenter.Show C#
0x28 in Cirrious.MvvmCross.Touch.Views.MvxTouchViewDispatcher. C#
0x28 in Cirrious.MvvmCross.Touch.Views.MvxTouchUIThreadDispatcher.RequestMainThreadAction C#
0x24 in Cirrious.MvvmCross.Touch.Views.MvxTouchViewDispatcher.ShowViewModel C#
0x30 in Cirrious.MvvmCross.ViewModels.MvxNavigatingObject.ShowViewModelImpl C#
0x6 in Cirrious.MvvmCross.ViewModels.MvxNavigatingObject.ShowViewModel C#
0xE in Cirrious.MvvmCross.ViewModels.MvxNavigatingObject.ShowViewModel<TestCustomPresenter.Core.ViewModels.FirstViewModel> C#
0x17 in Cirrious.MvvmCross.ViewModels.MvxAppStart<TestCustomPresenter.Core.ViewModels.FirstViewModel>.Start C#
> 0x3A in TestCustomPresenter.iOS.AppDelegate.FinishedLaunching at e:\Src\test\TestCustomPresenter\TestCustomPresenter.iOS\AppDelegate.cs:54 C#
0x9F in MonoTouch.UIKit.UIApplication.UIApplicationMain C#
0x52 in MonoTouch.UIKit.UIApplication.Main at /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38 C#
0x8 in TestCustomPresenter.iOS.Application.Main at e:\Src\test\TestCustomPresenter\TestCustomPresenter.iOS\Main.cs:23 C#
據我所知,目前沒有頂級視圖控制器,但我不知道如何設置,因爲我遵循了Stuart答案的所有步驟。 (我不能回答他的回答,我有9個代表太少:()
我上傳再現的錯誤http://www.cliffcawley.net/TestCustomPresenter.zip
我有什麼做的就是例子一個測試項目工作和看到自定義過渡,當你點擊按鈕?
感謝 - 請在問題中包含代碼或鏈接到可在線瀏覽的內容(例如github) - 如果可以的話 - 這使得在移動時更容易回答您的問題,代碼消失的可能性更小,問題仍然是在將來有意義:) – Stuart