-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
添加自定义手势导致的全屏滑动返回崩溃问题 #920
Comments
我上传了一份可以重现此bug的工程,你下载来看看 |
我的天,你误会了,handleNavigationTransition:这个方法是系统私有的,不需要我实现的。你看过我给你的重现工程了吗?你试试把pod去掉,不导入qmui_ios框架,就不崩溃,但是导入之后就找不到系统的handleNavigationTransition:这个方法,所以我猜可能是你的runtime把这个系统的私有方法给交换了。你去拿到我给你的重现工程,在pod文件里把pod 'QMUI_iOS'#掉,重新pod install ,再重新运行看看,看看pod QMUI_iOS和不pod 的区别 |
QMUI 修改了 id target = [self valueForKey:@"_cachedInteractionController"]; 至于 QMUI 是否应该修改 |
cocoapods告诉我,最新版本是1.1.0,你看一下对不对 |
已发布 4.1.0 ,为 |
Bug 表现
问题的具体描述
id target = self.interactivePopGestureRecognizer.delegate;
SEL handler = NSSelectorFromString(@"handleNavigationTransition:");
UIView *targetView = self.interactivePopGestureRecognizer.view;
在未pod QMUI_ios这个框架之前,上面这些代码是正常工作的,pod qmui_ios下来之后就崩溃,在#325 也提到过这个问题
截图
Bug 现场的界面截图,或者 Xcode 控制台的错误信息截图,有问题的代码截图
CRASH: -[DAMainNavigationController handleNavigationTransition:]: unrecognized selector sent to instance 0x12200f200
2020-03-07 15:13:31.329369+0800 小约会[8556:1892396] Stack Trace: (
0 CoreFoundation 0x00000001b2eeea5c 1B9B1E61-8CB4-3903-9870-402C3DE959BB + 1227356
1 libobjc.A.dylib 0x00000001b2c15fa4 objc_exception_throw + 56
2 CoreFoundation 0x00000001b2df25a8 1B9B1E61-8CB4-3903-9870-402C3DE959BB + 193960
3 UIKitCore 0x00000001b6f8f86c 27D3041D-A1DE-3C3A-8DC0-994B5982DC49 + 10688620
4 CoreFoundation 0x00000001b2ef2af4 1B9B1E61-8CB4-3903-9870-402C3DE959BB + 1243892
5 CoreFoundation 0x00000001b2ef4a7c _CF_forwarding_prep_0 + 92
6 UIKitCore 0x00000001b6b4f630 27D3041D-A1DE-3C3A-8DC0-994B5982DC49 + 6231600
7 UIKitCore 0x00000001b6b57d10 27D3041D-A1DE-3C3A-8DC0-994B5982DC49 + 6266128
8 UIKitCore 0x00000001b6b554a4 27D3041D-A1DE-3C3A-8DC0-994B5982DC49 + 6255780
9 UIKitCore 0x00000001b6b54a04 27D3041D-A1DE-3C3A-8DC0-994B5982DC49 + 6253060
10 UIKitCore 0x00000001b6b48998 27D3041D-A1DE-3C3A-8DC0-994B5982DC49 + 6203800
11 CoreFoundation 0x00000001b2e6be68 1B9B1E61-8CB4-3903-9870-402C3DE959BB + 691816
12 CoreFoundation 0x00000001b2e66d54 1B9B1E61-8CB4-3903-9870-402C3DE959BB + 671060
13 CoreFoundation 0x00000001b2e67320 1B9B1E61-8CB4-3903-9870-402C3DE959BB + 672544
14 CoreFoundation 0x00000001b2e66adc CFRunLoopRunSpecific + 464
15 GraphicsServices 0x00000001bcdec328 GSEventRunModal + 104
16 UIKitCore 0x00000001b6f61ae0 UIApplicationMain + 1936
17 小约会 0x0000000100330050 main + 132
18 libdyld.dylib 0x00000001b2cf0360 2E3F4750-8B67-398B-8530-8417651B1718 + 4960
)
2020-03-07 15:13:31.329968+0800 小约会[8556:1892396] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DAMainNavigationController handleNavigationTransition:]: unrecognized selector sent to instance 0x12200f200'
*** First throw call stack:
(0x1b2eeea48 0x1b2c15fa4 0x1b2df25a8 0x1b6f8f86c 0x1b2ef2af4 0x1b2ef4a7c 0x1b6b4f630 0x1b6b57d10 0x1b6b554a4 0x1b6b54a04 0x1b6b48998 0x1b2e6be68 0x1b2e66d54 0x1b2e67320 0x1b2e66adc 0x1bcdec328 0x1b6f61ae0 0x100330050 0x1b2cf0360)
libc++abi.dylib: terminating with uncaught exception of type NSException
如何重现
在pod qmui_ios的项目中写一个继承自uinavigationController的子类,并在viewDidLoad里面添加上面代码,push进一个界面后进行!全屏滑动返回!就崩溃。
预期的表现
正常情况下,全屏滑动返回是正常的,不会崩溃,在QMUINavigationController+QMUI.m的第53行,注释了selfObject.interactivePopGestureRecognizer.delegate = (id)selfObject; 这句代码后,又可以正常运行了。请修复一下吧。
其他信息
The text was updated successfully, but these errors were encountered: