Okay so I am working on a little ipad game for school. My problem is, I am trying to make this if statement work...
error: request for member 'x' in something not a structure or union
however it does not work. I figured I am going about it the wrong way, pretty much what I want to do is if object1 is directly over object2 the win message appears. My objects have outlets and are linked to my interface builder objects. Any advice, answers, anything will be really appreciated. I am a novice programmer and Objective-C is my first language.
Thanks,
Brandon
Code:
-(IBAction)CheckPosition{
if (Object1.x && Object1.y == Object2.x && Object2.y){
UIAlertView *playerWin = [[UIAlertView alloc] initWithTitle:@"You Win" message:@"GOOD JOB!" delegate:nil cancelButtonTitle:@"OKAY!" otherButtonTitles:nil];
[playerWin show];
}
}
however it does not work. I figured I am going about it the wrong way, pretty much what I want to do is if object1 is directly over object2 the win message appears. My objects have outlets and are linked to my interface builder objects. Any advice, answers, anything will be really appreciated. I am a novice programmer and Objective-C is my first language.
Thanks,
Brandon
Last edited by a moderator: