Domanda

I am making a game given in makeagamewithus.com named "PeevedPenguins".
I put _physicsNode variable in spritebuilder for gameplay scene and put CCPhysicsNode *_physicsNode in implementation class Gameplay as given in this Link.
But get an error CBReader: Couldn't find member variable: _physicsNode

È stato utile?

Soluzione

You we're not declaring your ivars correctly in your class.

Here is the problematic snippet from your code.

@implementation Gameplay
CCPhysicsNode *_physicsNode;
CCNode *_catapultArm;

You forgot the brackets, here is your corrected code.

@implementation Gameplay
{
    CCPhysicsNode *_physicsNode;
    CCNode *_catapultArm;
}

Altri suggerimenti

In spritebuilder make sure the pop-up menu is set to "Doc root var". Check your capitalization and spelling. Make sure the superclass of Gameplay is CCNode.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top