开发者

UISearchbar issue

I am tryi开发者_如何学Gong to add a UISearchbar to table header view. I have the icon in nib and have connected the outlets.

Now in viewDidLoad, I am writing self.tableView.tableHeaderView = searchbar

If i create a local var inside viewDidLoad, it shows up. But not the outlet or ivar one.

But for some reason, the UISearchbar does not get displayed in the table. I am not sure what the issue is. Can a UISearchbar not be set in viewDidLoad

OR is it something else?

Please help.


did you insert the SearchBarController or just the SearchBar object in IB? You have to choose the SearchBarController to interact with.

put in your tableView:didSelectRowAtIndexPath: or tableView:accessoryButtonTappedForRowWithIndexPath: method:

MyVC *vc = [[MyVC alloc]initWithNibName:@"MyVCNibName" andBundle:nil];
[self.view presentModalViewController:vc animated:YES];
[vc release];

you can also try and add a blank UIView with red backgroundColor to your view and see if its displayed (so you would know if the nib is loaded anyway)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜