Skip to content
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

iOS11 使用导航的搜索控制器属性,崩溃 #20

Open
YearRen opened this issue Jul 27, 2018 · 5 comments
Open

iOS11 使用导航的搜索控制器属性,崩溃 #20

YearRen opened this issue Jul 27, 2018 · 5 comments

Comments

@YearRen
Copy link

YearRen commented Jul 27, 2018

这是一个能稳定复现的崩溃
从页面A 模态弹出 页面B(页面B中使用self.navigationItem.searchController = self.searchController 添加搜索栏)
此时使用该类库会稳定崩溃,打开僵尸对象,控制台打印*** -[UINavigationBar release]: message sent to deallocated instance 0x7fa305303970
若移除该类库则正常
若无法复现我可以上传demo

@jasenhuang
Copy link
Owner

@YearRen 贴下关键代码?

@YearRen
Copy link
Author

YearRen commented Jul 27, 2018

TestNSObjectSafeDemo.zip
这个是完整的测试demo @jasenhuang

@YearRen
Copy link
Author

YearRen commented Jul 27, 2018

iOS 11.4.1 xcode 9.4.1 刚才试了真机 也是会崩溃,用的是我上面发的那个demo
点击进入下一页之后点击左上角的关闭按钮,会崩溃

@tedzhou
Copy link
Contributor

tedzhou commented Aug 2, 2018

        [NSArray swizzleClassMethod:@selector(arrayWithObjects:count:) withMethod:@selector(hookArrayWithObjects:count:)];

注释这行就好,但我还没想到为什么。

@YearRen
Copy link
Author

YearRen commented Aug 2, 2018

注释掉这个是不是相当于方法不交换了?功能上有什么影响么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants