views:

21

answers:

1

I've a view controller (named it as SearchViewController) with UITableView and UISearchBar. UISearchBar is set to table as a header view. While searching in the table using this searchbar works great.

By selecting any one of the displayed search results, I can move to next view (named it as DetailsViewController). But after returning to the SearchViewController, magically the UISearchBar is disappeared and my app is crashed. I found the same code is working fine on iOS 3.1.2 but not on iOS 4.0 (no idea about 4.0.1 or 4.0.2).

I'll be really thankful, if anyone has a work around for this.

A: 

I always use an UINavigationBar and an UINavigationItem to display the UISearchBar. Setting the navigationItem.titleView to the searchBar works fine for me. (Don't forget to call [theSearchBar sizeToFit])

Please give us more information on the crash. What is the console output?

Felix
Felix, thanks for quick response. As par my requirements I can’t use SearchBar with navigation controller. Well it seems a bug in the iPhone SDK 4.0. The crash report always says there is a problem in UIKit (not remember whats the problem is), not related to my view classes. I’m planning to use UISearchDisplayController instead of UISearchBar.
prathumca