私はヘッダーファイルでを宣言しUIView
ましたが(以下のように):
IBOutlet UIView *aCustomMsgBoxView;
RemoveSuperViewは、一方のメソッドでは機能しますが、もう一方のメソッドでは機能しません。私がこの方法にそれを入れればそれは働きます:
-(IBAction)showMsgBox:(id)sender
{
vc = [ViewController sharedInstance].self;
aCustomMsgBoxView = [[UIView alloc] init];
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"customMsgBox" owner:self options:nil];
aCustomMsgBoxView = [nibObjects objectAtIndex:0];
aCustomMsgBoxView.frame = CGRectMake(35, 80, 250, 146);
[vc.view addSubview:aCustomMsgBoxView];
}
しかし、私は上記の方法ではそれを必要としません、私はそれが機能しない以下の方法でそれを必要とします:
-(IBAction)hideMsgBox:(id)sender
{
[newAnnotationTitle resignFirstResponder];
[aCustomMsgBoxView removeFromSuperview];
}
もちろん、両方のメソッドは同じクラスにあります...
ビューが画面から削除されないのはなぜですか?