您应该委托 PresentModalView 的 parentView 并应该在 PresentModalView 的 viewWillDisappear 上调用 referesh 方法。
否则,您可以尝试推送通知并在 parentView 中观察。
- (void) refreshMyParentViewController{
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center postNotificationName:@"RefreshNeeded" object:self userInfo:refreshData];
}
//在ParentViewController--AddObserver中检测数据。// 还有你要调用的方法。
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(delegateMethod:)
name:@"RefreshNeeded" object:nil];
- (void)delegateMethod:(NSNotification *)notification {
NSLog(@"%@", notification.userInfo);
NSLog(@"%@", [notification.userInfo objectForKey:@"RefreshObject"]);
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(delegateMethod:)
name:@"RefreshNeeded" object:nil];
- (void)delegateMethod:(NSNotification *)notification {
NSLog(@"%@", notification.userInfo);
NSLog(@"%@", [notification.userInfo objectForKey:@"RefreshObject"]);
}