I`m doing something wrong with my app delegate, I’d appreciate if someone could have a look at this one .
My AppDelegate.h :
{
BOOL *moveState;
}
@property (nonatomic) IBOutlet BOOL *moveState ;
My AppDelegate.m:
@synthesize moveState;
and my ViewController from where I’m trying to set the moveState value :
AppDelegate *moveUp = (AppDelegate *) [[UIApplication sharedApplication] delegate];
[moveUp setMoveState:YES];
It`s returning : makes pointer from integer without a cast
You declare a pointer to
BOOL(BOOL *moveState) instead of a plainBOOL(BOOL moveState). Just change your interface:And by the way, you are probably designing the code wrong by storing the move state flag in the application delegate. Does the move state have anything to do with the application lifecycle? If not, why are you storing it in the application delegate? So that you can get it everywhere in the application through
[[UIApplication sharedApplication] delegate]? That’s misusing the singleton pattern, take a good look at Miško Hevery’s article called Singletons are Pathological Liars and the articles linked from there.