gpt4 book ai didi

ios - Cocos2d-iphone - Sphero 集成

转载 作者:塔克拉玛干 更新时间:2023-11-01 19:11:31 24 4
gpt4 key购买 nike

我正在尝试将 Sphero 连接到我正在构建的 Cocos2d 游戏。 Sphero 有一些好东西 documentation和示例,我可以运行示例代码。我从一个 cocos2d 项目开始,并添加了 Sphero 框架。我无法获得对球的基本指挥。我认为问题出在这个函数中:

-(void)setupRobotConnection 
{
/*Try to connect to the robot*/
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleRobotOnline) name:RKDeviceConnectionOnlineNotification object:nil];

if ([[RKRobotProvider sharedRobotProvider] isRobotUnderControl])
[[RKRobotProvider sharedRobotProvider] openRobotConnection];

}

(其余代码在链接中)我相信它与 NSNotificationCenter 有关。我从 CCLayerColor 调用此代码,而不是像演示那样从 UIViewController 调用。我收到此错误:

2012-08-25 01:54:19.738 bgmmo[1414:2d07] ERROR - opening session failed as protocol com.orbotix.robotprotocol is not declared in Info.plist

(已在 Sphero IOS Forum 中回答)

最佳答案

You need to add the external accessory protocol string to your Info.plist. Edit the Info.plist for you application target and add a entry for key "Supported external accessory protocols" which will create an array enter. Add "com.orbotix.robotprotocol" as a String item in the array.

关于ios - Cocos2d-iphone - Sphero 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12137681/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com