通知を使用できます。したがって、View Controller C では、次のことができます。
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// add notification to be informed if the app becomes active while
// this view controller is active, and if so, to invoke the
// appDidBecomeActive method.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appDidBecomeActive)
name:UIApplicationDidBecomeActiveNotification
object:nil];
}
- (void)appDidBecomeActive
{
// do whatever you want in this method. for example, if you did
// a modal segue (or presentViewController) to present this
// view controller's view, then you'd dismiss like thus:
[self dismissViewControllerAnimated:NO completion:nil];
}
- (void)viewWillDisappear:(BOOL)animated
{
// when this view disappears, we should remove the observer on
// the UIApplicationDidBecomeActiveNotification
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIApplicationDidBecomeActiveNotification
object:nil];
}