我認爲最好的方法,可能是唯一的方法是與[[UIApplication sharedApplication] openURL:...]一起使用URL方案。但我無法找到遊戲中心的URL方案。如何從我的應用程序運行iPhone GameCenter應用程序?
6
A
回答
16
您可以通過使用gamecenter:
URL方案推出的Game Center應用程序:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:"]];
-3
嘗試使用Apple示例代碼。它解釋了您的應用程序如何與gamecenter一起工作。 http://developer.apple.com/library/ios/#samplecode/GKTapper/Introduction/Intro.html
6
在iOS的6.0有一個新的方式相當冷靜使用GKGameCenterViewController顯示遊戲中心。
使用它您的視圖控制器必須作爲一個代表到GKGameCenterViewController:
@interface ViewController : UIViewController <GKGameCenterControllerDelegate>
然後用於顯示遊戲中心觀點:
- (void)showGameCenter
{
GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
if (gameCenterController != nil)
{
gameCenterController.gameCenterDelegate = self;
[self presentViewController: gameCenterController animated: YES completion:nil];
}
}
//Called when the player is done interacting with the GKGameCenterViewController
- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController
{
[self dismissViewControllerAnimated:YES completion:nil];
}
如果它的iOS 5.0下的用戶,你只能像以前說的那樣使用URL方案。
相關問題
- 1. 如何從我的應用程序運行Facebook應用程序
- 2. Gamecenter Facebook Like從應用程序執行
- 3. 從iPhone上運行應用程序隱藏應用程序
- 4. 如何從iPhone中的其他應用程序運行一個應用程序?
- 5. 當我在運行iPhone應用程序
- 6. 如何從SWT應用程序運行SWT應用程序?
- 7. 如何從Google Chrome應用程序運行Java應用程序?
- 8. 在應用程序上運行iphone應用程序
- 9. 從我的iPhone應用程序打開Spotify應用程序
- 10. 如何從Web應用程序加載iPhone應用程序
- 11. 如何從iPhone應用程序查看應用程序目錄
- 12. 如何使我的iPhone應用程序通用(iPhone - iPad)應用程序?
- 13. 如何從我的應用程序啓動iPhone設置應用程序?
- 14. 如何從我自己的應用程序打開iphone郵件應用程序?
- 15. 如何在iphone中運行我的應用程序背景?
- 16. 讓我的應用程序只運行應用程序
- 17. 如何從iPhone內部調用iPhone應用程序調用應用程序
- 18. iPhone:如何從你的應用程序
- 19. 從我的應用程序中的iPhone
- 20. 如何從我的應用程序啓動Facebook應用程序?
- 21. 如何從我的應用程序打開ola應用程序?
- 22. 運行應用程序在越獄iphone
- 23. iphone XMPP應用程序運行背景
- 24. iphone應用程序在後臺運行?
- 25. iPhone應用程序運行崩潰
- 26. iphone應用程序運行時異常
- 27. 如何從當前的應用程序運行獨立的應用程序?
- 28. 無法從我的iPhone應用程序
- 29. 運行Iphone模擬器從命令行運行應用程序
- 30. 使用我的Rails應用程序API for iPhone應用程序
這不是我所需要的,我知道如何與遊戲中心合作,但我的客戶希望有可能將用戶從他的應用程序直接重定向到GameCenter應用程序 – 2011-04-20 07:19:55