2011-09-12 32 views

回答

56

电话:

[self.tableView reloadData]; 
+0

让我试试这个...... –

+0

是不是它重新加载完整的表,如果是那么该怎么做刷新可见细胞! – CoDe

7

不得不NSNotification,一个在的loadView,另一个在

- (void)connectionDidFinishLoading:(NSURLConnection *)connection 

委托方法,像这样:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateTable) name:@"downloadCompleted" object:nil]; 
一旦数据从JSON解析得到

上面一个在的loadView方法,并在委托

[[NSNotificationCenter defaultCenter] postNotificationName:@"downloadCompleted" object:nil]; 

的updateTable方法以下一个将被调用。你可以在这个方法中调用tableview的reloadData方法来填充tableview和获得的值....希望这有助于..干杯...快乐编码..

+1

你需要有通知,因为你不知道什么时候数据获取从URL中完成.....希望你能让我...... – booleanBoy

0

调用表reloadData实例方法。哪里想要更新表格的数据。