Reputation: 1005
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
Upvotes: 3
Views: 996
Reputation: 3012
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;
}
Upvotes: 3
Reputation: 131
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.
Upvotes: 0