3

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

Andrey Chernukha
  • 21,488
  • 17
  • 97
  • 161
Meuk Light
  • 985
  • 1
  • 7
  • 9
  • Yeah you should make sure to double check everything. This functionality is one of the core things in SP and is working properly. From what you are describing, one of the possible pitfalls you may have fallen into is forgetting to export your project. Is that it? – Tibor Udvari Apr 09 '14 at 20:21
  • Thanks for the reply, I am really new to this , can you please specify where to export my project ? TIA. – Meuk Light Apr 10 '14 at 18:37
  • After you make changes you have to push the big publish button that is in the top left corner. Then you would go on to open the xcode project in your APPNAME.spritebuilder folder. – Tibor Udvari Apr 11 '14 at 07:04
  • Yeah i am publishing the project event cleaning the cache before publishing but not working. Is there any problem regarding the storage of file in source folder or any other folder ? Because when i use **Owner var** it does not show 'Couldnt find member varaible: _physicsNode' but gets nill in _physicsNode. TIA – Meuk Light Apr 13 '14 at 12:28
  • 1
    No, *owner var* is different. Use owner var when you want to present a pause menu for example. You would set the owner var to your PauseMenuController that you define to neatly seperate pause menu code from normal game code. Could you provide a zip with your project? I could take a look over it. – Tibor Udvari Apr 13 '14 at 16:48
  • To get the project please click [link](https://www.dropbox.com/s/mgpxz2wdx077yze/PeevedPenguins.spritebuilder.zip) – Meuk Light Apr 14 '14 at 19:49

2 Answers2

3

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;
}
Tibor Udvari
  • 2,932
  • 3
  • 23
  • 39
0

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.

ronm333
  • 131
  • 1
  • 9