Itβs good that he is disappointed that we donβt have a direct method that can be used to check in which view (view controller) a popover is displayed. What I'm doing in a tabbed app is:
New_iPadAppDelegate *appDel = (New_iPadAppDelegate *)[[UIApplication sharedApplication] delegate]; NSArray *viewConts = [(UINavigationController *)[[appDel tabBarController] selectedViewController] viewControllers]; MainViewController *viewController = (MainViewController *)[viewConts lastObject]; if([[viewController popoverController] isPopoverVisible]){ [viewController doStuff]; }
Hope this helps,
I know this is not the best way, hoping the apple will think about this problem, or if someone has developed a job.
Thanks,
Madhup
source share