简体   繁体   English

用数据重新加载TableView

[英]reload TableView with data

Basically i have a view with just a table view on it and on another tab you can add to this table view. 基本上我有一个只有一个表视图的视图,在另一个选项卡上你可以添加到这个表视图。 but when you click the tab with the table view in it isnt updating it self, so how would i reload the data in the table view i have tried : 但是当你单击带有表视图的选项卡时它不会自行更新,那么我将如何在我尝试的表视图中重新加载数据:

- (void) viewWillAppear: (BOOL) animated
{
[ThirdViewController.tableView reloadData];
}

with no success as i get error Expected ':' before '.' token 没有成功,因为我得到了错误Expected ':' before '.' token Expected ':' before '.' token . Expected ':' before '.' token

all of the cells are added via 所有单元格都通过添加

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

Any help would be great 任何帮助都会很棒

Looks like ThirdViewController is the name of a class, not an object. 看起来像ThirdViewController是类的名称,而不是对象。 Try just 试试吧

[tableView reloadData];

You can modify your app in the following way 您可以通过以下方式修改您的应用

1 Take a segmentation control above the table view. 1在表格视图上方进行细分控制。

2 When the user taps on any of the segment,take separate View Controller which is pushed onto the stack. 2当用户点击任何一个网段时,采取单独的View Controller,将其推入堆栈。

Cheers 干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM