0

I have a nib structure as shown in this image:

nib

Is there a way to add a Search bar in the Root VC? When I try to drag one in, it doesn't seem to like it...

Paul R
  • 202,568
  • 34
  • 375
  • 539
ICL1901
  • 7,416
  • 13
  • 90
  • 133

1 Answers1

1

You will need to add a tableView to the Root View Controller before you can add the search bar.

  • Thanks Andrew, I'll try that. – ICL1901 Jan 05 '12 at 18:33
  • I am actually adding the table view programmatically. Sorry for the red herring.. I guess I need to find a way to add the search bar programmatically too. Ideas welcome. – ICL1901 Jan 05 '12 at 19:01
  • Check out this answer: http://stackoverflow.com/questions/1302962/uisearchbar-sample-code – Andrew HunzekerHesed Jan 05 '12 at 19:06
  • Thanks again Andrew. I will mark this as answered as you did answer my original question. On the links you gave me - they are quite old (ios3). Has anything major changed? – ICL1901 Jan 05 '12 at 20:05
  • Things may have changed if you are using things like story boards but I still use the same search bar techniques that I used in iOS 3 – Andrew HunzekerHesed Jan 06 '12 at 16:40