How can UISearchDisplayController autorelease cause crash in a different view controller?

后端 未结 3 1500
醉话见心
醉话见心 2020-12-31 11:09

I have two view controllers A and B. From A, I navigate to view controller B as follows:

// in View Controller A 
// navigateToB method

-(void) navigateToB          


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 11:44

    I had the same issue. The searchDisplayController, was not made nil in the dealloc of the View controller, in which it was used. Instead the delegate managed the release of the searchDisplayController and this was done after, the tableView got released. Now after manually entering this code in the view controller's dealloc, its working fine now.

    self.searchDisplayController.delegate = nil; self.searchDisplayController.searchResultsDelegate = nil; self.searchDisplayController.searchResultsDataSource = nil;

    Thanks for your help.

提交回复
热议问题