2
運行如何能支持iOS 4的遊戲中心,但仍然在iOS 3,所以遊戲中心運行的應用程序將只適用於與iOS 4我如何支持遊戲中心iOS 4的,但仍然在3
運行如何能支持iOS 4的遊戲中心,但仍然在iOS 3,所以遊戲中心運行的應用程序將只適用於與iOS 4我如何支持遊戲中心iOS 4的,但仍然在3
設備你應該在gamekit框架和你的應用之間創建一個薄弱環節。您可以與項目設置中的任何框架建立薄弱環節。還請檢查蘋果遊戲套件編程指南以檢查遊戲中心是否可用。基本上它歸結爲單一功能
BOOL isGameCenterAvailable() {
// Check for presence of GKLocalPlayer API.
Class gcClass = (NSClassFromString(@"GKLocalPlayer"));
// The device must be running running iOS 4.1 or later.
NSString *reqSysVer = @"4.1";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
BOOL osVersionSupported = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);
return (gcClass && osVersionSupported);
}
以及包括GameKit/GameKit.h
頭文件在您的prefix.pch文件中。