我有一个弹出视图,我也添加了一个 PFQueryTableViewController 作为 childviewController。我在弹出窗口上有一个按钮,当按下它时,应该重新加载 PFQueryTableViewController 中的 tableview。
这是 buttonPressed 方法中应该执行此操作的代码:
NotificationsTableViewController *note = (NotificationsTableViewController *)self.childViewControllers[0];
[note loadObjects];
[note.tableView reloadData];
但是,该表没有重新加载,我可以让它重新加载的唯一方法是实例化一个全新的控制器并将其添加到弹出框,这不是我最终想要做的事情。
这是更多代码:
//NotificationsPopoverController
@class NotificationsTableViewController;
@protocol PopDelegate <NSObject>
-(void) changedQue;
@end
@interface NotificationsPopoverController : PDPopoverController
@property (nonatomic, assign) id<PopDelegate> myDelegate;
@property NotificationsTableViewController *noti;
当我按下按钮时,我调用 [self.myDelegate changedQue];
//NotificationsTableViewController.h
@interface NotificationsTableViewController : PFQueryTableViewController <PopDelegate>
//NotificationsTableViewController.m
-(void)changedQue
{
NSLog(@"Did it work?");
[self.tableView reloadData];
[self loadObjects];
}
由于某种原因没有打印日志语句,不知道为什么......