开发者

How to reload a tableview displayed in a popover

I'm dealing with an issue that's driving me crazy. I'm quite new in programming for IPaD (as much as i'm new to Objective C actually).

So my question may seem stupid but whatever.

I have a view containing a UITextField. When this field is selected, a popover containing a ListView is displayed in order to help the user by giving him a few suggestions for his search. My issue is that when the textfield.text is modified, i'd like the listView to filter its content to keep only the fields that begins like the textField.text.

When i try to call the method reloadData, it seems that it doesn't reach the method body and it开发者_开发问答 does nothing. Here's how i attempted to do it

UITableViewController *controller = (UITableViewController *)
[self.resultsPopoverController contentViewController];
[controller.tableView reloadData];

What's wrong with this way of doing it?


inside your controller's viewWillAppear method, reload the the tableview's data and it should be fine.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜