我明白dismissViewControllerAnimated:completion:
和popViewControllerAnimated:
之間的差,如所描述on Stack Overflow和這裏:後果爲編程:dismissViewController VS popViewController
-dismissViewControllerAnimated:completion:
方法用於解僱 一個的UIViewController,這是由該方法提出:-presentViewController:animated:completion:
。的UINavigationController的
-popViewControllerAnimated:
方法用於 彈出由 的UINavigationController的-pushViewController:animated
方法示出的控制器。
我最近在我的應用程序中發現了一個錯誤,在那裏我使用[self dismissViewControllerAnimated:completion:]
來解僱在導航嵌入式應用中推送的VC。我應該吃比薩餅時炸法。我沒有發現這個錯誤,因爲一切正常,我的VC被按預期解除分配。
我的問題:混合這兩種方法的後果是什麼?