我将如何重新加载视图控制器的表视图,关闭另一个视图控制器上的页面卷曲.

han*_*Dev 0 iphone objective-c page-curl ios

在关闭另一个视图控制器上的页面卷曲后,如何重新加载视图控制器的表视图.

我在viewController1上有一个tableview,其中有一个使用页面curl到viewController2的转换.

viewController1有一个tableView,需要在页面curl关闭后重新加载.

谢谢你的帮助

Ret*_*ogs 5

好,

在viewControllers1中,在viewDidLoad中注册一个通知:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:@"MyNotification" object:nil];
Run Code Online (Sandbox Code Playgroud)

并添加方法:

- (void)handleNotification:(NSNotification*)note {
   [tableView reloadData];
}
Run Code Online (Sandbox Code Playgroud)

在viewController2中,当你转到viewController1或者你想要重新加载表时发布通知:

[[NSNotificationCenter defaultCenter] postNotificationName:@"MyNotification" object:self];
Run Code Online (Sandbox Code Playgroud)