I'm trying to connect a Sphero to a Cocos2d game I'm building. Sphero has some good documentation and examples, and I can run the sample code. I started with a cocos2d project and added the Sphero frameworks. I am not able to get a basic command to the ball. I believe the issue is in this function:
-(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];
}
(The rest of the code is at the link) I believe that it has something to do with the NSNotificationCenter. I am calling this code from a CCLayerColor, rather than a UIViewController like the demo does. I get this error:
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
(This was answered in the Sphero IOS Forum)