So , i have this void where i initialize the GUI and remove it when it's clicked the play image i call it with [self GUI:1]; and [self GUI:0];
The GUI comes up but when i try to hide it it's not working but it's entering in the if()
-(void)GUI:(int)action{
// GUY LOADING
UIImageView *menu =[[UIImageView alloc] initWithFrame:CGRectMake(self.view.center.x-350/2,self.view.center.y-300/2,350,200)];
UIImageView *menuplay =[[UIImageView alloc] initWithFrame:CGRectMake(self.view.center.x-270/2,self.view.center.y-50/2,133,50)];
UIImageView *menuretry =[[UIImageView alloc] initWithFrame:CGRectMake(self.view.center.x+5,self.view.center.y-50/2,133,50)];
menu.image=[UIImage imageNamed:@"menustart.png"];
menuplay.image=[UIImage imageNamed:@"menuplay.png"];
menuretry.image=[UIImage imageNamed:@"retrymenu.png"];
if(action == 1){
[self.view addSubview:menu];
[self.view addSubview:menuplay];
[self.view addSubview:menuretry];
}
if(action == 0){
[menu removeFromSuperview];
[menuplay removeFromSuperview];
[menuretry removeFromSuperview];
}
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(StartGame:)];
singleTap.numberOfTapsRequired = 1;
[menuplay setUserInteractionEnabled:YES];
[menuplay addGestureRecognizer:singleTap];
}
the StartGame selector only executes the following code
[self GUI:0];
and the viewDidLoad only executes the following code
[self GUI:1];
// GUY LOADING
? Why are you loading a guy? – Popeye