【发布时间】:2013-04-13 22:47:17
【问题描述】:
这让我发疯 - 我有一个带有 @property picTable 的 ParentViewController 类(没有 xib),然后是带有 xib 和 File's Owner 的 picTable 部分的 ChildViewController(ParentViewController 的子类)。
我注意到了这个问题,因为我需要从 URLRequest 添加更多数据 - 我在 NSArray 中有数据,但调用 reloadData 什么也没做 - 断点显示 self.picTable 为空 - 但它肯定是链接的(通过断点检查)视图生命周期的早期阶段。
我尝试使用 NSNotificationCenter、调度队列和 [self performSelectorOnMainThread... 都无济于事 - 我的 refreshTableView 总是被调用,但断点显示表视图为空。
试过了——
@property (nonatomic, strong) IBOutlet UITableView *picTable;
还有——
@property(非原子,保留)IBOutlet UITableView *picTable;
两个类的链接:
家长: https://github.com/gileze33/Ticklr/blob/master/Ticklr/GWTPicPresentingViewController.h https://github.com/gileze33/Ticklr/blob/master/Ticklr/GWTPicPresentingViewController.m
子类: https://github.com/gileze33/Ticklr/blob/master/Ticklr/GWTPicViewController.h https://github.com/gileze33/Ticklr/blob/master/Ticklr/GWTPicViewController.m
【问题讨论】:
-
你应该发布你提到的两个类的源代码
-
刚刚在 GitHub 上添加了指向源代码的链接
-
只是为了确认 - 似乎所有 UI 元素都在 viewDidLoad 之后立即被释放..
标签: ios uitableview null xcode4.6 reloaddata