UIAlertView 팝업을 사용할 수 있도록 사용자 지정 UINavigationController 클래스를 만들었으며 다시 단추를 누를 때이 뷰를 그대로두고 싶습니다. 문제가 있지만UINavigationController 사용자 지정 popViewControllerAnimated 메서드
- (UIViewController *)popViewControllerAnimated:(BOOL)animated
{
if([[self.viewControllers lastObject] class] == [weddingSetupController class]){
UIAlertView *exitAlert = [[UIAlertView alloc]
initWithTitle:@"Are you sure?"
message:@"By leaving the setup, all current changes will be lost. The setup can be retsrated later if you decide to leave now. However, it is recomened for your best experience that you complete the setup."
delegate:self cancelButtonTitle:@"No"
otherButtonTitles:@"Yes", nil
];
[exitAlert show];
return nil;
}
else {
return [super popViewControllerAnimated:animated];
}
}
그 내가 말한다면 '아니오'는 동일한 뷰에 남아있는 동안, 부모 터지는하지 않는 것이, 잘 작동 :
나는 고객에게 그래서 아래와 같은 방법을 보기를 클릭하면 탐색 모음이 표시됩니다. 그래서 팝업보기를 얻지 만 바는 항상 부모보기의 상태로 돌아갑니다.
호프가이 문제를 해결하는 데 도움이 될 수 있기를 바랍니다. 감사합니다.
NavigationBar에서 팝이 허용되는 경우 질문에 대한 viewcontroller를 어떻게 얻습니까? – netshark1000
야곱,이 방법을 재정의하기 위해 카테고리를 어떻게 사용했는지 설명하거나 설명해 주시겠습니까? 다음과 같이 정의 된 범주가있는 경우 : @interface UINavigationController (BackBtnAdditionLogic) 및 override popViewControllerAnimated. 응용 프로그램의 모든 뒤로 버튼이 무시됩니다. 나는 그것을 피하려고 노력하고 있는데, 단지 몇 개의 ViewController 만 사용자 정의 된 로직을 필요로합니다. –