Question: I have a requirement where in my application should show alert boxes (dialogue forms). The issue is that the latest alert should be shown first and on closing it the next one - and so on. So I decided to move the dialogue creation to separate threads so that they are not required to be closed for remaining code to execute.

I did something like below. but the issue is that they dont appear as dialogues(can move on to main form without closing them). So I decided to use `ShowDialog(IWin32Window)`
But it gives me cross thread operation invalid error.

How to handle this case?

```
private void button2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 3; i++)
            {
                new Thread(new ThreadStart(ShowDialogue)).Start();
                Thread.Sleep(1500);
            }
        }

 private void ShowDialogue()
        {          
                FormDialogue fd = new FormDialogue(-1);
                fd.ShowDialog( ); 

        }

```

Answer: 
Ok, so it turns out a nice lunch time walk really helps in these situations. Here is my answer for anyone else who has a similar problem.

I first include `<UITabBarControllerDelegate>` in the .h of my app delegate. And in the `didFinishLaunchingWithOptions` method I set the delegate of the tab bar:

```
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
tabBarController.delegate = self;

```

Then I can use this method to toggle whether or not to show the background image or not:

```
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
    UITabBar *tabBar = tabBarController.tabBar;
    if (tabBar.selectedItem == [tabBar.items objectAtIndex:2]) {
        [tabBar setSelectionIndicatorImage:[[UIImage alloc] init]];
    }
    else {
        [tabBar setSelectionIndicatorImage:nil];
    }
}

```
I've tried implementing this in my code. However I made the original tab bar in storyboards and it doesn't seem to be overridden when I add a tab bar in my app delegate. I was wondering how I'd go around doing it?

I can override the tab bar items like so 

```
//create new tab bar appearance
UITabBar *tabBar = [UITabBar appearance];
//set background image
[tabBar setBackgroundImage:[UIImage imageNamed:@"menu.png"]];
//create a colour and apply it as tint colour when items aren't selected.
UIColor *color=[UIColor colorWithRed:64.0/255.0 green:147.0/255.0 blue:52.0/255.0 alpha:255.0];
UIColor *colorSelected=[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
[tabBar setTintColor:color];
[tabBar setSelectedImageTintColor:colorSelected];

[tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"selection-tab.png"]];

```

All of that is just in the didfinishloadingwithoptions