Just for completeness, I thought I'd add in how to determine if the view controller is being displayed in a tab based app:
+(BOOL) isSelectedViewController:(UIViewController *)someVC;
{
myAppDelegate *appD = [[UIApplication sharedApplication] delegate];
UIViewController *selectedVC = [appD.TabBarController selectedViewController];
return selectedVC == someVC;
}