You need to pop the navigation controller in your first tab bar to root, [firstTabBarViewController.navigationController popToRootViewControllerAnimated:NO];
Only problem with this is you need to have a reference to your first tabs view controllers.
Another way you could do it (And i have used this method before) is to use local notifications.
In your first view controllers viewDidLoad method add the following line to register for a notification, you can name the notification anything you like maybe something like DatabaseChangedNotification.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(databaeHasChanged:) name:@"DatabaseChangedNotification" object:nil];
Then add a new (void) method called databaseHasChanged, this method will be called each time the notification is raised. Your databaseHasChanged method should look something like:
-(void)databaseHasChanged
{
[self.navigationController popToRootViewControllerAnimated:NO];
}
Then in your dealloc method make sure you unregister the notification using the following code:
[[NSNotificationCenter defaultCenter] removeObserver:self];
The above code will setup your first view controller to listen and handle the DatabaseChangedNotification.
Now all you need to do is add some code to your second view controller which changes the database. After the database has changed just fire the DatabaseChangedNotification using the following code:
[[NSNotificationCenter defaultCenter] postNotificationName:@"DatabaseChangedNotification"
object:nil];