0
我想呈現一個ModalView,每當我的應用程序收到Pushnotification。 通知到達後,我的應用程序會在應用程序中顯示任何UIViewController
。訪問當前活動顯示的UIViewController
我需要這個UIViewController
調用
[presentingViewController presentModalViewController:vc animated:YES];
// presentingViewController is what I need :)
有沒有辦法找出哪些UIViewController的是當前活動?
我會知道如何做到這一點,例如, UITabbarController
或UINavigationController
,但我不能依靠任何一個的存在。
我也試圖通過
[[[UIApplication sharedApplication] keyWindow] rootViewController]
得到RootViewController的,並從那裏呈現ModalView,但 - 當然 - 它不會顯示任何其他推/顯示的視角。
這種方法的問題會觸及我班以外的其他代碼,這是不可能的。 – alex 2012-07-11 12:21:01