1

我写了一个 mvvmcross touch 示例应用程序,基本上是 CustomerManagement 教程的翻版。我的 CustomersListViewModel 中有一位客户。

当我运行该应用程序时,我在输出中收到以下错误(请看这篇文章的结尾)。

如果我在我的安装程序类中加载了一堆不需要的插件,错误就会消失。这可能是时间问题吗?

您可以在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
4

1 回答 1

0

感谢您提供完整的错误日志和 github repro。

空白跟踪错误消息让我感到困惑......

但我猜这个错误是由于我们的标准表格视图单元格包装器默认创建一个图像加载器 - 请参阅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 插件,而后者又使用 File 插件。(如果您希望将图像更永久地保存在磁盘上,它还需要像 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 上。

在真正的应用程序中,我不倾向于使用标准单元格,而且我也倾向于总是需要下载缓存和文件插件 - 所以我个人并不认为这是我工作中的常见问题。

于 2013-05-14T15:15:57.553 回答