iOS Development: Should the “playersToInvite” property contain an array of strings or an array of GKPlayer objects?

StackOverflow https://stackoverflow.com/questions/4634944

سؤال

Should the playersToInvite property of the GKMatchRequest object contain an array of NSString objects that hold the player id's or should it contain an array of GKPlayer objects? The documentation on this critical property is not clear at all and I've tried both ways, but my code isn't working, so I can't tell by experimentation.

Here's the description for that property in the docs...

A list of players to invite to the match.

Why did they even bother writing that?

Thanks for your help!

هل كانت مفيدة؟

المحلول

I believe this is answered with the Game Kit Programming Guide when it states:

The playersToInvite parameter is non-nil when your application is launched directly from the Game Center application to host a match. This parameter holds an array of player identifiers for the players to invite to the game

Have to agree with you regarding the GKMatchRequest docs - that's quite uncharacteristically poor of Apple.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top