0
를 작동하지 않습니다RemoveFromSuperView (아래로)
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];
}
물론 두 방법 모두 같은 클래스에 있습니다 ...
왜 화면에서보기가 제거되지 않습니까 ??
당신의 [newAnnotationTitle resignFirstResponder]; 일하는거야? 근래에 그걸 확인해 봤어? – IronManGill
CustomMsgBoxView를 두 번 설정하고 있습니다. 한 번은 이니셜 라이저로, 두 번째로 펜촉으로 된 물건으로. 그리고'vc = [ViewController sharedInstance] .self;'는 냄새를 풍기고 있습니다. – Abizern
'removeFromSuperview'를 호출하기 직전에'aMustomMsgBoxView'가'hideMsgBox'에 가지고있는'NSLog' 값이 있습니까? 그것? – sergio