简体   繁体   English

Monocross是否已准备好在iOS设备上使用?

[英]Is Monocross ready for professional use on an iOS device?

When creating a simple app with Monocross (using MonoTouch) and compiling for an iOS device I get some bad warnings, like this: 使用Monocross创建一个简单的应用程序(使用MonoTouch)并为iOS设备编译时,我会收到一些错误的警告,如下所示:

Warning MT4112: The registrar found a generic type: MonoCross.Touch.MXTouchViewController`1. 警告MT4112:注册商发现了一个通用类型:MonoCross.Touch.MXTouchViewController`1。 Registering generic types with ObjectiveC is not supported, and will lead to random behavior and/or crashes. 不支持使用ObjectiveC注册泛型类型,并且会导致随机行为和/或崩溃。 (MT4112). (MT4112)。

I've read all I can find about using MonoTouch with generics on an iOS device and it's mostly not supported. 我已经阅读了有关在iOS设备上使用带有泛型的MonoTouch的所有内容,但它几乎不受支持。 My app currently works on an actual device, but the warnings worries me. 我的应用程序目前适用于实际设备,但警告让我担心。

I guess my question is, what is the state of Monocross when you get these warnings even with the simplest of apps? 我想我的问题是,即使使用最简单的应用程序,当你收到这些警告时,Monocross的状态是什么? Is it still not ready for professional use or are the warnings not relevant for the way generics is used in Monocross? 它还没有准备好用于专业用途,还是与Monocross中使用仿制药的方式无关的警告?

I can also add the following from Xamarin.iOS docs: "Xamarin.iOS does not currently support creating generic subclasses of the NSObject class" 我还可以从Xamarin.iOS文档添加以下内容:“Xamarin.iOS目前不支持创建NSObject类的通用子类”

Which is exactly what Monocross does, with for example the MXTouchTableViewController class. 这正是Monocross所做的,例如MXTouchTableViewController类。

There is some history to this: creating generic subclasses of NSObject has never been a supported scenario, but unfortunately MonoTouch never enforced, nor warned about this fact. 这有一些历史:创建NSObject的通用子类从来就不是受支持的场景,但遗憾的是MonoTouch从未强制执行,也未对这一事实发出警告。 So people of course ended up doing exactly this. 所以人们当然最终做到了这一点。

Then one day I had to track down something that looked like a true heisenbug, and it turned out (after many hours of frustrating debugging) to be because the project in question was using generic subclasses of NSObject. 然后有一天我不得不追踪看起来像真正的heisenbug的东西,事实证明(经过几个小时的令人沮丧的调试)是因为有问题的项目使用了NSObject的通用子类。 The exact details are not important, but that's when the warning was added to MonoTouch. 确切的细节并不重要,但是当警告被添加到MonoTouch时。

My point here is people have been using generic subclasses of NSObject for a long time, without running into any problems. 我的观点是人们长期使用NSObject的通用子类,而不会遇到任何问题。 If you test your app extensively (which you should do anyway), don't worry about this. 如果您广泛测试您的应用程序(无论如何应该这样做),请不要担心这一点。

But if you do run into strange and inexplicable behavior, we'll most likely ask you to fix these warnings before looking into any claims that you've found a bug in MonoTouch. 但是,如果您遇到奇怪且无法解释的行为,我们很可能会在您查看您在MonoTouch中发现错误的任何声明之前要求您修复这些警告。

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

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