I've been trying to remove my view from an action called from other ViewController but I don't know how to do it
Here is my code:
 + (Menu *)Mostrar:(UIView *)view{
     CGRect IMGFrame = CGRectMake( 5, 20, 70, 70 );
     UIButton *boton=[[UIButton alloc] initWithFrame:IMGFrame];
     [boton setBackgroundImage:[UIImage imageNamed:@"Logo_SuperiorBTN.png"] forState:UIControlStateNormal];
     [boton setBackgroundImage:[UIImage imageNamed:@"Logo_SuperiorBTN.png"] forState:UIControlStateSelected];
     [boton addTarget: self action: @selector(cerrarmenu:) forControlEvents: UIControlEventTouchUpInside];
     [boton setTag:899];
     [view addSubview: boton];
}
That part is called from my MainViewController like this
-(IBAction)menu:(id)sender{
    Menu *hudView = [Menu Mostrar:self.view];
}
Then it shows the view and when I try to close it using the button it crashes
The code to close the menu is
+(void)cerrarmenu:(UIView *)view{
    for (UIView *subView in view) {
        if (subView.tag == 899) {
            [subView removeFromSuperview];
        }
    }
}
Thanks Santiago
 
     
     
     
     
     
    