I am working in tabBar based iPhone app.
- I have 5 UIViewControllers in tabbar controller.
- In my application I have used APNS. When APNS received I want to update data in
UIViewController
4. - If the user working in
UIViewController
s 1,2,3 and 5 i want to update the data inUIViewController
4 and show badges. - I refresh and updated the data in UIViewController 4 but I want to show the badge if the user not in the
UIViewController
4. - If the user currently in
UIViewController
4 i don't want to show the badges.
How can i find another one UIViewController
is in active or inactive from some other UIViewController
?
Edit
I have tried below code to get the selectedIndex of UITabBarController.
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSLog(@"%d", appDelegate.tabBarController.selectedIndex);