Xcode 7 beta 5 を使用して単純なマルチプレイヤー Swift プログラムを作成しようとしています。実行時に次のエラーが発生しました。
[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack
そして、試行錯誤したところ、このコードの一部が何らかの形でこのエラーを引き起こしていることがわかりました。
func setupMatchHandler() {
/* This function handles invite as sent by other users */
GKMatchmaker.sharedMatchmaker().matchForInvite(GKInvite().self , completionHandler: { (invitedMatch , invitationError) -> Void in
if invitationError != nil {
// error out
print("Game Center error: \(invitationError)")
}
if invitedMatch != nil {
// success
print("invitation received!")
}
})
}
ここの専門家は、ここで何がうまくいかなかったのかを明らかにできるのだろうか? どうもありがとう!
サム