UINavigationBar disappears using UISearchBar and SearchDisplayController

Here is my scenario:

(1) I have a TabBarController with the following:

      (A)  Navigation Controller (rootviewcontroller is a uitableviewcontroller) = Tab 0

      (B)  UIViewController = Tab 1

(2) The navigation controller uses the UISearchBar along with the UISearchDisplayController

(3) I click and enter a search in the search bar, and then click β€œSearch” on the keyboard to close the keyboard, leaving the search results displayed.

(4) Then I click on Tab # 1.

(5) Then I "Simulate a memory warning"

(6). Go to tab # 0

(7). Click Cancel on UiSearchBar

(8) VOILA! The navigation bar has disappeared. Missing. Not there.

Any ideas?

Thank,

Mike

+3
1
[self.navigationController setNavigationBarHidden:NO animated:YES];
0

Source: https://habr.com/ru/post/1763717/


All Articles