Domanda

I am getting the following error and crash on my iPad 1 - on iOS 5 only - though my iPhone 5S and iPhone 5 run the following piece of code just fine:

[GKTurnBasedMatch loadMatchWithID:_match.matchID withCompletionHandler:^(GKTurnBasedMatch *match, NSError *error)
{
 .....
}];

The exact error is:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[GKTurnBasedMatch loadMatchWithID:withCompletionHandler:]: unrecognized selector sent to class 0x3f6d59c0

It may be worth nothing that I do not get this crash when running the iPad simulator.

È stato utile?

Soluzione

It looks like loadMatchWithID wasn't actually exposed until iOS 6.0. I have the 5.0, 5.1, 6.0 and 7.0 SDKs available in my Xcode and can see that this method is not there in GKTurnBasedMatch.h until iOS 6.

The apple docs and iOS 6.0 and 7.0 SDK header GKTurnBasedMatch.h seems to be wrong with respect to when some methods became available.

There are also others that are wrong, that's not the only method tagged as being there in iOS 5.0 but is not there until iOS 6.0.

Here are the other two inaccuracies I found in that header with the same issue:

- (void)declineInviteWithCompletionHandler:completionHandler

- (void)acceptInviteWithCompletionHandler:completionHandler

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top