Can't access variable declared by SpriteBuilder

73 views Asked by At

I'm doing this tutorial.

To separate menu button and game content I added a CCNode named _contentNode that include all gaming content and publish it to XCode as the tutorial indicated.

But I get Use of undeclared identifier '_contentNode' error when I try to run it in XCode.

This is the SpriteBuilder screenshot how I set the variable. Is there something wrong with this?

enter image description here

1

There are 1 answers

0
ironsand On

I forgot I must declare variable in the code like this:

@implementation Gameplay {
    //...
    CCNode *_contentNode;
}