简体   繁体   English

如何在cocos2d中的场景上显示MCBrowserViewController?

[英]How can you show an MCBrowserViewController on a scene in cocos2d?

I'm porting a code to ios7 in wich I used old GKPeerPickerController and cocos2d to make a multiplayer game over Bluetooth. 我正在使用旧的GKPeerPickerController和cocos2d通过蓝牙将代码移植到ios7。 In the new version, I'm using the MCBrowserViewController, but im unable to show it on the scene. 在新版本中,我正在使用MCBrowserViewController,但无法在现场显示它。

Im calling it with 我打电话给

[[[CCDirector sharedDirector] view] addSubview: browserVC];

where browserVC is an initiallized MCBrowserViewController but as this is only to show UIViews I get the error 这里的browserVC是一个初始化的MCBrowserViewController,但是这只是为了显示UIViews,我得到了错误

Cannot initialize a parameter of type 'UIView *' with an rvalue of type 'MCBrowserViewController *' 无法使用“ MCBrowserViewController *”类型的右值初始化“ UIView *”类型的参数

Is there any way to show the MCBrowserViewController on the scene? 有什么办法可以在现场显示MCBrowserViewController吗? Thanks in advance! 提前致谢!

应该管用

[[CCDirector sharedDirector] presentViewController:browserVC animated:YES completion:nil];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM