Xcode cocos2d:“您必须遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他有关法律法规。”;使用未声明的标识符子项;你是说“你的孩子”吗;
在我的cocos2d项目中,我的助手方法是:Xcode cocos2d:“您必须遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他有关法律法规。”;使用未声明的标识符子项;你是说“你的孩子”吗;,xcode,cocos2d-iphone,identifier,Xcode,Cocos2d Iphone,Identifier,在我的cocos2d项目中,我的助手方法是: -(CCMenuItem *) itemForTouch: (UITouch *) touch { CGPoint touchLocation = [touch locationInView: [touch view]]; touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation]; CCMenuItem* item; CCARRA
-(CCMenuItem *) itemForTouch: (UITouch *) touch
{
CGPoint touchLocation = [touch locationInView: [touch view]];
touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation];
CCMenuItem* item;
CCARRAY_FOREACH(children_, item)
{
// ignore invisible and disabled items: issue #779, #866
if ( [item visible] && [item isEnabled] ) {
CGPoint local = [item convertToNodeSpace:touchLocation];
CGRect r = [item rect];
r.origin = CGPointZero;
if( CGRectContainsPoint( r, local ) )
return item;
}
}
return nil;
}
代码可以正常工作,但是我一直收到错误“使用未声明的标识符子项”\uux;您是指子项吗?我的所有变量都会收到这个错误,在单词后面加了一个“”。
这是一个xcode“问题”还是我可以在我的xcode项目中添加一些东西来防止我出现这个错误,还是与我的xcode版本有关
感谢您在此错误上为我提供的任何帮助!:)
谢谢!
John我假设这是来自早期版本cocos2d的代码,或者您已在项目中升级了cocos2d。按照Objective-C中的标准,IVAR(大多数)的名称已从尾随下划线后缀更改为前导下划线后缀 因此,正确的用法是:
_children