错误:使用未声明的标识符'touchesBegan'

时间:2014-03-10 02:51:17

标签: ios

我收到以下错误

使用未声明的标识符' touchesBegan'

在@implementation

下的以下代码中
    SKTexture* eyeTexture1 = [SKTexture textureWithImageNamed:@"eye1"];
eyeTexture1.filteringMode = SKTextureFilteringNearest;
SKTexture* eyeTexture2 = [SKTexture textureWithImageNamed:@"eye2"];
eyeTexture2.filteringMode = SKTextureFilteringNearest;

    SKAction* flap = [SKAction repeatActionForever: [SKAction animateWithTextures:@[eyeTexture1,     eyeTexture2] timePerFrame:0.2]];

_eye = [SKSpriteNode spriteNodeWithTexture:eyeTexture1];
[_eye setScale:2.0];
_eye.position = CGPointMake(self.frame.size.width / 4, CGRectGetMidY(self.frame));
[_eye runAction:flap];

}





-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
/* Called when a touch begins */

1 个答案:

答案 0 :(得分:0)

我以前遇到过这个问题。你错过了touchesBegan上面的方法吗?加入即可。