NSUrlConnection具有表视图和搜索显示控制器

时间:2012-01-23 15:42:30

标签: iphone nsurlconnection uisearchdisplaycontroller

我正在编写一个从mysql数据库获取数据的iPhone应用程序。我试图使用搜索显示控制器搜索数据库,因为用户在搜索栏中输入了输入,但我遇到的问题是在nsurlconnection方法之前调用了uitableview方法。

我目前的编码逻辑如下;

- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope 
//code to start connection

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
//populate array of search results

//Load data into search results
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

有谁知道如何使这项工作或知道另一种方法吗?如果有什么不清楚或者您需要更多信息,请告诉我。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

在填充搜索结果后是否正在调用[tableView reloadData]

相关问题