我想从我的其他一个名为“Properties”的类中重新加载另一个名为“WriteIt_MobileAppDelegate”的类中的表视图。我试图通过 NSNotificationCenter 类来做到这一点 - 日志被调用但表从未更新。
属性.h:
[[NSNotificationCenter defaultCenter] postNotificationName:@"NameChanged"
object:[WriteIt_MobileAppDelegate class]
userInfo:nil];
WriteIt_MobileAppDelegate.m
-(void)awakeFromNib {
[[NSNotificationCenter defaultCenter] addObserver:self 选择器:@selector(reloadItProperties:) name:@"NameChanged" object:self];
}
- (void) reloadItProperties: (NSNotification *)notification {
NSLog(@"Reloading Data"); //this gets called
[[self navigationController] dismissModalViewControllerAnimated:YES];
[self.navigationController popToRootViewControllerAnimated:YES];
[self.tblSimpleTable reloadData];
[self.tblSimpleTable reloadSectionIndexTitles];
// but the rest doesn't
}
我在这里做错了什么?