で使用するビューにサブビューを追加するアプリを作成しaddSubview:ていIBActionます。同じように、そのボタンIBActionが再度タッチremoveFromSuperviewされたときに、その上に追加されたサブビューを呼び出す必要がありますIBAction。
疑似コード
-(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];
}
}