How to add search bar in navigation bar for iphone?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3350681/how-to-add-serach-bar-in-navigation-bar-for-iphone">How to add serach bar in navigation bar for iPhone</a>  </p>
</blockquote>



<p>This is the code to display search bar but i want to put this in navigation bar</p>

<pre><code>sBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0,10,320,30)];

sBar.delegate = self;

[self.view addSubview:sBar];
//[self.navigationItem.rightBarButtonItem addSubview:sBar];
//self.navigationItem.rightBarButtonItem=sBar;
</code></pre>

<p>is there any way?</p>
