受信ローカル通知の処理には多くの問題があります。 私のアプリはストーリーボードを使用しており、rootviewcontrollerとしてtabbarcontrollerを持っています。 は現在、私は次のように「didReceiveLocalNotification」からmodalviewsを起動します。通知に応じてモーダルビューを新しいウィンドウとして表示するにはどうすればよいですか? (親なしvc)
MedicationReminderViewController *vc = [[MedicationReminderViewController alloc] initWithNibName:@"MedicationReminderViewController" bundle:nil];
vc.notificationInfo = [[NSDictionary alloc] initWithDictionary:notification.userInfo];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:vc];
navController.navigationBar.barStyle = UIBarStyleBlackOpaque;
navController.title = @"title";
UITabBarController *tc = (UITabBarController *)self.window.rootViewController;
UINavigationController *nc = (UINavigationController *)tc.selectedViewController;
[[nc visibleViewController] presentModalViewController:navController animated:YES];
これは、すべての行事に動作しますが、ありません。私はその時に表示されることができる他のものの上に新しいウィンドウでモーダルビューを提示したいと思います。ユーザーが着信通知を処理すると、モーダル表示が自動的に閉じられ、通知が届く前にアクティブだった基になるビューが再び表示されます。どうすればこれを達成できますか?
どのように "それを行う"私の質問です:) – Pieter
私の答えを更新しました。 –