わかりました、私はそれを簡単にあきらめることはないと思います:)これが私の問題に対して見つけた解決策です。モーダル ビュー コントローラー内からメイン アプリ ビューを表示しているため、次のようにしました。
iOS 5 以降、すべてのビュー コントローラーにはpresentedViewControllerプロパティがあります。それさえわかれば、あとは簡単です。AppDelegate.m 内の特定のコードを次に示します。
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
if ([[userInfo objectForKey:@"notificationType"] isEqualToString: @"messageType"]) {
UITabBarController * tabBarController = (UITabBarController *)[self.window.rootViewController presentedViewController];
[tabBarController setSelectedIndex:kChatViewIndex];
// My view controller that I presented modally is a tabBar, your case can be different.
// ... so from here I can reach any navigation controller or any other view from inside my app
}
ビュー コントローラーを取得したので、それが tabBarController の場合は setSelectedIndex: を使用でき、ナビゲーション ユニットの場合は特定のビュー コントローラーをプッシュできます。
これが同様の問題を抱えている人に役立つことを願っています。乾杯!