I am creating an application where I add subview to the view using addSubview: on IBAction . Similarly, when a button with this IBAction touches again, call removeFromSuperview on this preview added on this IBAction :
PSEUDO CODE
-(IBAction)showPopup:(id)sender { System_monitorAppDelegate *delegate = (System_monitorAppDelegate *)[[UIApplication sharedApplication] delegate]; UIView *rootView = delegate.window.rootViewController.view; if([self popoverView] is not on rootView) { [rootView addSubview:[self popoverView]]; } else { [[self popoverView] removeFromSuperview]; } }
ios cocoa-touch uikit uiview
pmerino Sep 14 '11 at 18:38 2011-09-14 18:38
source share