아래쪽 탭으로 탐색 할 수있는 탐색 기반 앱을 만들고 각 탭에는 자체 탐색 스택이 있습니다. 대부분의 부품이 예상대로 작동하지만 하나의 특정 탭이 예기치 않게 작동합니다. 무슨 일performSegue는 다음 뷰 컨트롤러를 원하지 않는 뷰 계층 구조로 푸시합니다.
은 다음과 같습니다
여러 뷰 컨트롤러를 탐색 한 후,의 말 [A] [B] [C] 및 [D], 다음 컨트롤러 [E]가 갑자기 탐색 스택에서 이동 할 수 있습니다. 보기가 모달로 표시되는 것처럼 보이고 탐색 스택이 이렇게 보입니다.
(lldb) po [[[UIWindow keyWindow] rootViewController] _printHierarchy]
<MyApp.CRTabBarController 0x112026800>, state: disappeared, view: <UILayoutContainerView 0x111e1fa00> not in the window
| <UINavigationController 0x112027a00>, state: disappeared, view: <UILayoutContainerView 0x111e23f50> not in the window
| | <MyApp.X1_ViewController 0x111d12490>, state: disappeared, view: <UIView 0x111e32d70> not in the window
| | | <MyApp.InsideX1_ViewController 0x112096200>, state: disappeared, view: <UIView 0x111e35d90> not in the window
| <UINavigationController 0x11200aa00>, state: disappeared, view: (view not loaded)
| | <MyApp.X2_ViewController 0x111d22360>, state: disappeared, view: (view not loaded)
| <UINavigationController 0x11205a200>, state: disappeared, view: (view not loaded)
| | <MyApp.X3_Controller 0x11205a800>, state: disappeared, view: (view not loaded)
| <UINavigationController 0x112059600>, state: disappeared, view: (view not loaded)
| | <MyApp.X4_ViewController 0x111e0cea0>, state: disappeared, view: (view not loaded)
| <UINavigationController 0x112058e00>, state: disappeared, view: <UILayoutContainerView 0x111d50370> not in the window
| | <MyApp.A_ViewController 0x111d25f70>, state: disappeared, view: <UIView 0x116e0ad90> not in the window
| | | <MyApp.PageViewController 0x112891400>, state: disappeared, view: <_UIPageViewControllerContentView 0x113feb0a0> not in the window
| | | | <MyApp.InnerPageViewController 0x111ee3bf0>, state: disappeared, view: <UIView 0x111e6e000> not in the window
| | <MyApp.B_ViewController 0x113ee8280>, state: disappeared, view: <UIView 0x116e37cf0> not in the window
| | <MyApp.C_Controller 0x118f06f10>, state: disappeared, view: <UIView 0x113ee46f0> not in the window
| | <MyApp.D_ViewController 0x116e5f580>, state: disappeared, view: <UIView 0x118f2fe70> not in the window
+ <E_ViewController 0x116ecff30>, state: appeared, view: <UIView 0x111ee43f0>, presented with: <_UIFullscreenPresentationController 0x116e13420>
위에서 네 개의 네비게이션 컨트롤러는 여기에 관심이없는 비활성 탭입니다. 마지막 탭의 탐색에서 A_ to D_ - ViewController's
을 볼 수 있습니다. 그런 다음 E_ViewController
이 다른 탐색 계층 구조에 있는데, 이것이 여기서 문제입니다.
코드는 꽤 똑 바릅니다. D_ViewController
은 이와 같이 performSegue
을 호출합니다.
self.performSegue(withIdentifier: "goto_E", sender: self)
Segue
설정도 꽤 정상적이라고 생각합니다. 그것은 단지 id와 "Show"를 스타일로 지정합니다. Segue
은 D_ViewController
에서 E_ViewController
으로 연결되어 있으므로 performSegue's
식별자 arg로 참조 할 수 있습니다.
아무도 경험이 종류 있었나요? 가능한 이유에 대한 추측은?
D에서 E까지의 세그가 체인의 다른 것들과 같습니까? B에서 C 또는 C에서 D로 말합니까? –
네, 모두 같습니다. 나는 segues를 클릭하여 시각적으로 비교했으며 식별자를 제외하고는 아무것도 변경하지 않았습니다. –
그리고 그들은 B_ViewController를 C_ViewController로, C_ViewController를 D_ViewController에 동일한 방식으로 사용합니까? –