xamarin - [Xamarin][Mvvmcross] 无法查找所需的编组信息
问题描述
我正在关注 iOS 项目的 mvvmcross教程。我认为我正在做的正是那里的描述,但是当我运行应用程序时,我收到以下错误:
ObjCRuntime.RuntimeException
Message=Failed to lookup the required marshalling information.
Additional information:
Selector: setGenerositySlider:
Type: TipView
Source=
StackTrace:
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.2.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.2.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at TipCalc.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\MYUSERNAME\source\repos\xamarin\TipCalc.Core\TipCalc.iOS\Main.cs:12
我从样本中克隆了相同的项目,它运行良好。我想我比较了我能做的所有事情,据我所知,项目都是一样的。
namespace TipCalc.iOS
{
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");
}
}
}
namespace TipCalc.iOS
{
[Register(nameof(AppDelegate))]
public class AppDelegate : MvxApplicationDelegate<MvxIosSetup<App>, App>
{
public override UIWindow Window { get; set; }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
var result = base.FinishedLaunching(application, launchOptions);
return result;
}
}
}
public partial class TipView : MvxViewController<TipViewModel>
{
public TipView() : base(nameof(TipView), null)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
var set = this.CreateBindingSet<TipView, TipViewModel>();
set.Bind(TipLabel).To(vm => vm.Tip);
set.Bind(SubTotalTextField).To(vm => vm.SubTotal);
set.Bind(GenerositySlider).To(vm => vm.Generosity);
set.Apply();
View.AddGestureRecognizer(new UITapGestureRecognizer(() =>
{
this.SubTotalTextField.ResignFirstResponder();
}));
}
}
后面生成的代码
namespace TipCalc.iOS
{
[Register ("TipView")]
partial class TipView
{
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UISlider GenerositySlider { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UITextField SubTotalTextField { get; set; }
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UILabel TipLabel { get; set; }
void ReleaseDesignerOutlets ()
{
if (GenerositySlider != null) {
GenerositySlider.Dispose ();
GenerositySlider = null;
}
if (SubTotalTextField != null) {
SubTotalTextField.Dispose ();
SubTotalTextField = null;
}
if (TipLabel != null) {
TipLabel.Dispose ();
TipLabel = null;
}
}
}
}
我在这里想念什么?
解决方案
推荐阅读
- dynamics-crm - 如何获取不在特定队列/团队中的用户?
- highcharts - Highcharts .Net(最新)YAxis.GridLineDashStyle Hashtable 不适用于客户端库
- perl - Perl - 如何从数组 M 维计算 N 个字节的 CRC16(使用 N
我需要计算从大小为 M 的二进制文件(一对 Kb,与我的范围不太相关)中提取的 N 字节(示例中为 5,为简单起见)的 CRC16。
printf "offset\tvalue\tcrc16\n"; #Read N bytes from file and copy in the container
- r - 子集,未按预期选择
- spring-cloud-dataflow - Spring Cloud 数据流:错误 org.springframework.dao.InvalidDataAccessResourceUsageException
- next.js - NextJS 语言环境随动态路由变化
- c++ - 如何使用 ESPAsyncTCP 库在 ESP8266 上设置 TCP 服务器以及指针如何工作
- amazon-athena - Athena Engine V1 到 V2 在结构列上变慢
- php - 并行执行循环 php 中的所有 Web 服务调用
- node.js - Passport-SAML:entryPoint / auth 请求标头被覆盖