您应该委托PresentModalView的parentView,应该调用referesh方法上PresentModalView的viewWillDisappear。
否则,你可以尝试推送通知和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"]);
}
为什么要重新加载父视图? – 2013-02-26 06:48:36
我在“UIModalPresentationFormSheet”视图中编辑一些数据。我想在父视图中显示更改。 – Suppry 2013-02-26 06:49:45
你需要一些其他的通知的变化(KVO,NSNotificationCenter,委托传递引用和调用该方法,如此多的方式) – 2013-02-26 06:54:08