美文网首页
应该执行的代码却没有执行

应该执行的代码却没有执行

作者: Fsn_soul | 来源:发表于2021-05-06 15:14 被阅读0次

今天又遇到了应该执行的代码却没有执行的情况

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source;

- (nullable id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed;

- (nullable UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(nullable UIViewController *)presenting sourceViewController:(UIViewController *)source API_AVAILABLE(ios(8.0));

打断点代理方法presentationControllerForPresentedViewController是执行了的,但是1,2代理方法没有执行,顿感莫名其妙,调了好久才发现原来是方法1,2被重写执行到其他地方去了。这种情况有时候会很隐蔽特别是OC的类别特性,导致重写的时候很难被找到。以后遇到这种应该执行的代码却没有执行的情况最好打符号断点。

相关文章

网友评论

      本文标题:应该执行的代码却没有执行

      本文链接:https://www.haomeiwen.com/subject/nplddltx.html