由于打开Game Center View Controller时控制台中出现iOS 9错误。我创建了一个裸骨样本项目来帮助诊断和隔离问题。我的裸骨视图控制器包含一个UIButton来打开游戏中心,我的代码如下:
import UIKit
import GameKit
class ViewController: UIViewController, GKGameCenterControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
let localPlayer = GKLocalPlayer()
localPlayer.authenticateHandler = {(viewController, error) -> Void in
if let viewController = viewController {
self.presentViewController(viewController, animated: true, completion: nil)
}else{
print("(GameCenter) Player authenticated: \(GKLocalPlayer.localPlayer().authenticated)")
}
}
}
@IBAction func openGameCenter(sender: AnyObject) {
let gameCenter = GKGameCenterViewController()
gameCenter.gameCenterDelegate = self
self.presentViewController(gameCenter, animated: true, completion: nil)
}
func gameCenterViewControllerDidFinish(gameCenterViewController: GKGameCenterViewController) {
gameCenterViewController.dismissViewControllerAnimated(true, completion: nil)
}
}
在展示Game Center View Controller时,我在控制台中看到以下错误:
2015-09-21 11:03:41.530 GameCenterTest [1552:415921] - 在仅变换中更改属性masksToBounds 层,将无效2015-09-21 11:03:41.531 GameCenterTest [1552:415921] - 改变 属性masksToBounds在仅变换图层中,将不起作用 2015-09-21 11:03:41.532 GameCenterTest [1552:415921] - 改变属性maskToBounds in transform-only 层,将无效
点击Done
并关闭Game Center View Cotroller时,我在控制台中看到以下错误:
2015-09-21 11:03:52.263 GameCenterTest [1552:416142]插件 com.apple.GameCenterUI.GameCenterDashboardExtension无效