0
触摸我的_关注按钮,触发_learn按钮的^块。它看起来好像在发射错误的块,因为它是一个匿名或未命名的块。我试图说出它的名字,但似乎无法做到。有没有其他人有这个问题?或者知道正确命名块的语法,以便我的按钮不会感到困惑?为什么带有块的CCMenuItemImage触发错误的触摸块?
_learn= [CCMenuItemImage itemFromNormalImage: _learnButtonPath selectedImage: _learnButtonPath disabledImage:_learnButtonPath block:^(id sender)
{
NSLog(@"Learn Button has been touched!");
...
}
_follow= [CCMenuItemImage itemFromNormalImage: _onFollowButtonPath selectedImage: _onFollowButtonPath disabledImage:_offFollowButtonPath block:^(id sender)
{
NSLog(@"FollowButton has been touched!");
...
}
哪版本的cocos2d-iphone? – Lukman
感谢您的回应Lukman,我在版本1,我发现什么是错的。我修改了CCMenu.itemForTouch来记录x y ccp,但错过了添加大括号的操作,导致它总是激发第一个menuItem ... – Azeworai