I have a view controller based UITableViewController
, I want to reload the table view when receive update notification:
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateApStatus:) name:@"UpdateApStatus" object:nil];
}
- (void)updateApStatus{
NSLog(@"......updateApStatus......");
[self.tableView reloadData];
}
And I post notification in other class:
[[NSNotificationCenter defaultCenter] postNotificationName:@"UpdateApStatus" object:self];
The error is :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MenuViewController updateApStatus:]: unrecognized selector sent to instance 0xb25bf80'
It seems like i can not access self