Pergunta

- (void)tapped:(id)sender
{
    if (counter ==1) {

        bluetest.position = ccp(400, 400);
    }
}

blue = [[CCMenuItemImage
            itemFromNormalImage:@"blue.png" selectedImage:@"blueclick.png"
             target:self selector:@selector(tapped:)];  //error occurs here

    bluetest.position = ccp(175, 350);
    bluetest = [CCMenu menuWithItems:blue, nil];
    bluetest.position = CGPointZero;
    bluetest.scale = .75;
    [self addChild:bluetest z:3];

The error says "expected identifier". What can I do to fix the error?

Foi útil?

Solução

@user2083920,

Remove first '['. You have used double '[' in the starting and there is only one closing ']'. Then compiler will search for another closing ']' and gives above error or If you forget to paste all the here. Please paste original code.

 [[CCMenuItemImage
            itemFromNormalImage:@"blue.png" selectedImage:@"blueclick.png"
             target:self selector:@selector(tapped:)];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top