Why: “Attempting to load .. while deallocating… :UISearchController:”

最后都变了- 提交于 2019-12-05 11:33:11
Andrew Ebling

I would recommend using Storyboard Unwind Segues instead: https://developer.apple.com/library/ios/technotes/tn2298/_index.html

This insightful post also has a wealth of very useful implementation detail:

What are Unwind segues for and how do you use them?

andrewbuilder

I've come across the same console error message, but note the following regarding my Xcode project:

  • segues to navigation controllers must remain due to their use with a split view controller (to the detail view controller);
  • (and according to @AndrewEbling comments above) the code does not require unwind segues as the navigation controller manages (a proportion of) the tasks automatically;
  • also the code does not require unwind segues as blocks are used to set properties in parent view controller.

Thanks to comments by Leehro and Clafou in this SO answer the console error message was suppressed by using following line of code in viewDidLoad (note that there is no need to insert this in dealloc):

[self.searchController loadViewIfNeeded]; (note available from iOS 9).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!