I have been attempting to have a object that I can use across multiple view controllers by following this thread.
http://stackoverflow.com/questions/851158/one-instance-across-multiple-views
But it has not been working for me. So I started with the basics to see what was going on. I created a local instance of the object.
PlayerData *playerOne = [[PlayerData alloc] init];
playerOne.completedRound += 1;
I can inspect this in the debugger and I see 0 for all values when I create it and then it gets updated by the appropriate line of code so I feel like my object class is written correctly.
When I try to define the object in my header file to like this:
In my UIViewController.h I added the following
#import "PlayerData.h"
PlayerData *playerOne;
@property (nonatomic, retain) PlayerData *playerOne;
In my UIViewContoller.m I have added the following
#import "PlayerData.h"
@synthesize playerOne;
playerOne.completedRound += 1;
I cannot get it to work. The code compiles fine but viewing the instance in the debugger non of the variable ever get set.