我有一个基于视图控制器UITableViewController
,我想在收到更新通知时重新加载表视图:
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateApStatus:) name:@"UpdateApStatus" object:nil];
}
- (void)updateApStatus{
NSLog(@"......updateApStatus......");
[self.tableView reloadData];
}
我在其他班级发布通知:
[[NSNotificationCenter defaultCenter] postNotificationName:@"UpdateApStatus" object:self];
错误是:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MenuViewController updateApStatus:]: unrecognized selector sent to instance 0xb25bf80'
好像无法访问self