使用monogame构建默认iOS解决方案时出现错误消息

当我尝试在Monotouch上构建默认的“MonoGame.Framework.iOS.sln”时,有谁知道为什么我收到以下错误消息?我怎么解决这个问题? :

指南源文件的第468行(来自MonoGame.Framework.iOS> iOS> GamerServices> Guide.cs
我明白了

public static void ShowMatchMaker()
{
     AssertInitialised ();

if ( ( Gamer.SignedInGamers.Count > 0 ) && ( Gamer.SignedInGamers[0].IsSignedInToLive ) )
   {
    // Lazy load it
if ( matchmakerViewController == null )
   {
     matchmakerViewController = new GKMatchmakerViewController(); }

//该行上的错误是 – 类型’MonoTouch.GameKit.GKMatchmakerViewController’不包含带有’0’参数的构造函数.

解决方法

默认构造函数(实际上是GKMatchmakerViewController类型的init选择器)无效(遗憾的是,关于可以使用init初始化的内容的Apple文档有点缺乏).

同样从iOS6开始,这会在运行时抛出一个ObjectiveC异常:

Objective-C exception thrown.  
Name: NSInvalidArgumentException 
Reason: <GKMatchmakerViewController: 0x16101160>: 
must use one of the designated initializers

因此,这个默认构造函数以及其他一些构造函数被删除,因为它们的使用可能会导致早期iOS版本中出现奇怪的崩溃(并且你不希望你的游戏在iOS6上行为不端).

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...