简体   繁体   English

iOS更换插座— Monotouch

[英]iOS changing outlets — Monotouch

I created labels and textfields, but I named them to something that was wrong. 我创建了标签和文本字段,但是将它们命名为错误的名称。 Because I use Android I did tv_xxx <-- textview, and not tf_xxxx <--textfield... 因为我使用Android,所以我做了tv_xxx <-textview,而不是tf_xxxx <-textfield ...

So, what I did was I deleted the IBOutlets from the header file and the .m file. 因此,我要做的是从头文件和.m文件中删除了IBOutlets。 I also deleted them from the designer.cs file. 我还从designer.cs文件中删除了它们。

The designer.cs file, however, does not like this because it still thinks they are still existant. 但是,designer.cs文件不喜欢此文件,因为它仍然认为它们仍然存在。

this class is not key value coding-compliant for the key tv_xxxx

When I temporarily put the : 当我暂时放:

[Outlet]MonoTouch.UIKit.UITextField tf_xxx { get; set; }

It works... But is there anyway I can make it so it doesn't look for this anymore? 它可以工作...但是无论如何我都可以做到,所以不再寻找它了?

In XCode, right click on your controller or view where the old outlets were. 在XCode中,右键单击控制器或查看旧插座所在的位置。

A black popup should appear with all your outlets. 您所有的插座都应出现一个黑色的弹出窗口。 You should see the old ones in the popup with warning exclamation points--delete them. 您应该在弹出窗口中看到带有警告感叹号的旧文件-删除它们。

The key value coding-compliant error means you have an outlet defined in a XIB or Storyboard, but not on the class. key value coding-compliant错误意味着您在XIB或Storyboard中定义了插座,但在类中未定义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM