xamarin.在中使用一夫一妻制构建默认iOS解决方案时出现错误消息



有人知道我在Monotatouch上构建默认的"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初始化什么的文档)。

同样从iOS6开始,这将在运行时引发ObjectiveC异常:

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

因此,这个默认构造函数和其他一些构造函数被删除了,因为它们的使用可能会在早期的iOS版本中导致奇怪的崩溃(无论如何,你都不希望你的游戏在iOS6上表现不佳)。

相关内容

最新更新