Frage

The main controller is a tabBarController; one of the tabs is navigationController, then in that navigationController is a UItableView with searchDisplayController.

SearchBar is in UItableView.

enter image description here enter image description here enter image description here

However, I dont' know what I have changed (I should use snapCapture next time....). My searchBar is gone.

What I mean gone is that after my compilation, I cannot find the seaerchBar in my tab. (It is okay before I am changing sth; coz I have changed a lot, I cannot load back anymore)

I have printed a log like, [self.searchDisplayController description]

But it is NULL.

Can sbd suggest me some directions for me to check? Thanks

War es hilfreich?

Lösung 2

I found my fault it is.

Should be

@interface ThirdViewController : ***UIViewController*** 

NOT

@interface ThirdViewController : ***UITableViewController*** 

UIViewController Class Inherits from UIResponder : NSObject

UITableViewCell Class Inherits from UIView : UIResponder : NSObject

I think that is why for tableview, I cannot show the search bar. So, in my case, I hope can help others do not make any not necessary changes, like me @@

And please do use snapCap

Andere Tipps

In each Tab you need to add only one navigation controller, inside that you need to add either viewcontroller or tableview controller or search display viewcontroller. You need add the objects in the above way, i dont think you have added in this format, from the image you have provided, there is only one tab in that you have added 3 navigation controllers..

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top