Error message when creating a default iOS solution in monogame

Does anyone know why I get the following error message when I try to create a default MonoGame.Framework.iOS.sln on Monotouch? And how can I fix this?

on line 468 of the original manual file (from MonoGame.Framework.iOS> iOS> GamerServices> Guide.cs I get

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

// the error in this line is the type 'MonoTouch.GameKit.GKMatchmakerViewController' does not contain a constructor that accepts the arguments "0".

+4
source share
1 answer

The default constructor (in fact, the init selector for the GKMatchmakerViewController type) was not valid (unfortunately, Apple's documentation about what can be initialized with init is a bit missing).

Also starting with iOS6, this will throw an ObjectiveC exception at runtime:

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

Thus, this default constructor, along with several others, was deleted, since their use could cause strange crashes in earlier versions of iOS (and you do not want your game to work badly on iOS6).

+1
source

Source: https://habr.com/ru/post/1440164/


All Articles