2013-05-14 72 views
1

我寫了一個mvvmcross觸摸示例應用程序,基本上是一個CustomerManagement教程的翻版。 我在我的CustomersListViewModel中有一個客戶。Mvvmcross tableviewcell綁定錯誤

當我運行該應用程序時,我在輸出中看到以下錯誤(查看本文結尾處)。

如果我在我的設置類中加載了一堆不需要的插件,錯誤消失了。這可能是一個時間問題?

您可以在https://github.com/patbonecrusher/MvxTableViewSampleApp.git

Starting iOS simulator 6.1 
Launching application 
Application launched. PID = 95621 
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll [External] 
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll [External] 
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.dll [External] 
Thread started: #2 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvxBindingTableTest/bin/iPhoneSimulator/Debug/MvxBindingTableTest.exe 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross- Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.MvvmCross.Touch.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.MvvmCross.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.MvvmCross.Dialog.Touch.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.CrossCore.Touch.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.CrossCore.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.MvvmCross.Binding.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.MvvmCross.Binding.Touch.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvxBindingTableTest.Core/bin/Debug/MvxBindingTableTest.Core.dll 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/CrossUI.Touch.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/CrossUI.Core.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.MvvmCross.Plugins.File.dll [External] 
Loaded assembly: /Volumes/dagon/Users/pat/Projects/learning-sandbox/MvxBindingTableTest/MvvmCross-Binaries/XS-iOS-Mac/bin/Release/Mvx/Touch/Cirrious.MvvmCross.Plugins.ResourceLoader.dll [External] 
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/Mono.Security.dll [External] 
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll [External] 
2013-05-14 10:47:47.266 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.00 Setup: PlatformServices start 
2013-05-14 10:47:47.277 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.05 Setup: Bootstrap actions 
2013-05-14 10:47:47.287 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.06 Setup: StringToTypeParser start 
2013-05-14 10:47:47.291 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.06 Setup: ViewModelFramework start 
2013-05-14 10:47:47.293 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.06 Setup: PluginManagerFramework start 
2013-05-14 10:47:47.295 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.07 Setup: App start 
2013-05-14 10:47:47.296 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.07 Setup: ViewModelTypeFinder start 
2013-05-14 10:47:47.297 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.07 Setup: ViewsContainer start 
2013-05-14 10:47:47.299 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.07 Setup: ViewDispatcher start 
2013-05-14 10:47:47.299 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.07 Setup: Views start 
2013-05-14 10:47:47.311 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.08 Setup: CommandCollectionBuilder start 
2013-05-14 10:47:47.312 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.08 Setup: NavigationSerializer start 
2013-05-14 10:47:47.313 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.08 Setup: LastChance start 
2013-05-14 10:47:47.326 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.10 Setup: Secondary end 
2013-05-14 10:47:47.327 MvxBindingTableTest[95621:c07] mvx: Diagnostic: 0.10 Showing ViewModel CustomerListViewModel 
2013-05-14 10:47:47.330 MvxBindingTableTest[95621:c07] TouchNavigation: Diagnostic: 0.10 Navigate requested 
2013-05-14 10:47:47.405 MvxBindingTableTest[95621:c07] MvxBind: Error: 0.18 MvxBind 

回答

0

感謝完整的錯誤日誌和GitHub的攝製找到該項目的代碼。

空白跟蹤錯誤信息混淆我...

但我猜測,這個錯誤是由我們的標準表視圖細胞包裝默認創建一個ImageLoader的事實造成的 - 看https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Touch/Views/MvxStandardTableViewCell.cs#L57

我猜想,痕跡不知何故來自https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding/Views/MvxBaseImageViewLoader.cs#L30

此圖像加載程序使用DownloadCache插件,它反過來使用文件插件。 (如果你希望它永久保存磁盤上的圖像,它還需要像JSON插件那樣的文本序列化程序)。

如果你不想在你的應用圖片 - 所以不希望這些插件 - 那麼它看起來並不像你能避免這個問題,並繼續使用標準電池在不改變源。

如果你想解決此問題:

1,你可以創建自己的標準表電池包裝(基於https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Touch/Views/MvxStandardTableViewCell.cs#L57) 2,你可以使用創建一個自定義單元格。 3你可以註冊一個虛擬/空服務來滿足IMvxImageHelper<UIImage> - 這會工作,但我並不真的喜歡它作爲解決方案。

如果你認爲這是一個嚴重的問題,我們應該提供一個核心修復,請登錄它在github/slodge/mvvmcross的問題。

在實際的應用程序,我不傾向於使用標準電池,我也傾向於總是需要downloadcache和文件的插件 - 所以我不親自來過這個在我的工作中常見的問題。

+0

Thanks Stuart!這有助於......我可以解決這個問題..沒什麼大不了的加載插件...只是想確保我沒有瘋狂! :d – 2013-05-14 15:20:44