今天又遇到了应该执行的代码却没有执行的情况
- (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的类别特性,导致重写的时候很难被找到。以后遇到这种应该执行的代码却没有执行的情况最好打符号断点。
网友评论