0

このエラーインスタンスメソッド '-setTouchEnabled:' が見つかりません (戻り値の型のデフォルトは 'id' です) 原因がわかりません。助けていただければ幸いです :) 私のコードが乱雑な場合は申し訳ありません

- (id) init
{
    if ((self = [super init])) {
        CGSize winSize = [CCDirector sharedDirector].winSize;
        CCSprite *player = [CCSprite spriteWithFile:@"start.png"];
        player.position = ccp(player.contentSize.width/2, winSize.height/2);
        [self addChild:player];
        [self schedule:@selector(gameLogic:) interval:0.5];
        [self setTouchEnabled:YES];
        _monsters = [[NSMutableArray alloc] init];
        _projectiles = [[NSMutableArray alloc] init];

        // stuff that needs updating
        [self schedule:@selector(update:)];
        //labels
        StrategyBullet = 10;
        Strategyscore = 0;
        CCLabelTTF *label2 = [CCLabelTTF labelWithString:@"Ninja stars " fontName:@"Arial" fontSize:15];

        label2.position = ccp(400,310);

        label2.color = ccc3(255, 0, 0);

        [self addChild: label2 z:1];

        CCLabelTTF *label = [CCLabelTTF labelWithString:@"Score" fontName:@"Arial" fontSize:15];

        label.position = ccp(30,310);

        label.color = ccc3(255, 0, 0);

        [self addChild: label z:1];

        StrategyscoreLabel = [CCLabelTTF labelWithString:@"0" fontName:@"Arial" fontSize:14];
        StrategyscoreLabel.position = ccp(65, 310);
        StrategyscoreLabel.color = ccc3(255, 255, 255);
        [self addChild:StrategyscoreLabel z:1];

        StrategyBulletLabel = [CCLabelTTF labelWithString:@"0" fontName:@"Arial" fontSize:14];
        StrategyBulletLabel.position = ccp(450, 310);
        StrategyBulletLabel.color = ccc3(255, 255, 255);
        [self addChild:StrategyBulletLabel z:1];



    }

    return self;
}
4

1 に答える 1