【发布时间】:2016-02-11 16:14:50
【问题描述】:
我正在尝试从我的 FirstViewController 重新加载我的 SingleGrid 的 UITableView。
UITableView 的声明是 IBOutlet 和在我的 AppDelegate 中声明的 singleGrid 变量。
我想从 FirstViewController 重新加载 singleGrid 的 UITableView。表视图名称 singleGridTable 不在点之后。
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate.singleGrid.singleGridTable reloadData]
【问题讨论】:
-
@shehzad ali 我不明白你的意思是什么?这段代码在我的 FirstViewController 中,我也写了 firstViewController 的 viewdidload 的顶部:AppDelegate *appDelegate= [[UIApplication sharedApplication] delegate];
-
您的 singleGridTable 被声明为 SingleGrid 的 .h 文件中的属性?
@property (nonatomic, weak) IBOutlet UITableView * singleGridTable; -
在SingleGrid.m的顶部是这样声明的 // SingleGrid.m文件 @interface SingleGrid () property (nonatomic, strong) IBOutleT UITableView *singleGridTableView;结束
-
将其移至 .h 文件。届时它将公开,并对您的 firstViewController 可见。
-
好吧,我会尝试thanx很多
标签: ios tableview appdelegate reloaddata