4

Does anybody know why I get the following error message when I try to build the default "MonoGame.Framework.iOS.sln" on Monotouch? And how I can fix this? :

on line 468 of the Guide source 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(); }

// error on that line is-- type 'MonoTouch.GameKit.GKMatchmakerViewController' does not contain a constructor that takes '0' arguments.

poupou
  • 43,413
  • 6
  • 77
  • 174
Sonia Brami
  • 127
  • 1
  • 1
  • 10
  • I found that solution I guess I'll try this for now: It sounds like they removed the constructor for MonoTouch.GameKit.GKMatchmakerViewController that required no parameters. There are five constructor signatures for MonoTouch.GameKit.GKMatchmakerViewController, but each requires that an argument be passed. I was able to get past this error by commenting out everything in the ShowMatchMaker() method in guide.cs. I then received another error saying iOS6 doesn't support ARMv6, so I changed the minimum platform version from 4.0 to 5.0 and everything is now successfully building. – Sonia Brami Oct 16 '12 at 23:56

1 Answers1

1

The default constructor (actually the init selector for the GKMatchmakerViewController type) was invalid (sadly Apple documentation on what can be initialized with init is a bit lacking).

Also starting with iOS6 this would throws an ObjectiveC exception at runtime:

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

As such this default constructor, along with a few others, were removed since their use could cause weird crashes in earlier iOS releases (and you do not want your game to misbehave on iOS6 anyway).

poupou
  • 43,413
  • 6
  • 77
  • 174
  • :) Thank you poupou. Is commenting out the entire ShowMatchMaker method the best solution for now? what should I do? Please let me know I am a bit lost. – Sonia Brami Oct 17 '12 at 00:33
  • @SoniaBrami I'm not sure. You should contact (or wait for an answer from) the MonoGame people. They *likely* already have a fix for this since iOS6 and MonoTouch 6 have been released for about a month now. – poupou Oct 17 '12 at 00:55
  • Yes they answered http://monogame.codeplex.com/discussions/399669#editor @poupou thank you! – Sonia Brami Oct 17 '12 at 01:09