1

Where i should put this code in my app to reset tab bar controller i found this solution in below link in stackoverflow Change language in app - how to restart?

((AppDelegate)UIApplication.SharedApplication.Delegate).MainTabBarController.Reset();
public class MainTabBarController : UITabBarController
{
public override void ViewDidLoad()
{
    Reset();
    SelectedIndex = 2;
}

public void Reset()
{
    ViewControllers = new UIViewController[]
    {
        new ViewControllerTab1(),
        new ViewControllerTab2(),
        new ViewControllerTab3(),
        new ViewControllerTab4(),
        new ViewControllerTab5()
    };
}
} 
Community
  • 1
  • 1
wod
  • 812
  • 1
  • 10
  • 23

1 Answers1

1

Just call the Reset method from whatever component of your UI is changing the language.

miguel.de.icaza
  • 32,654
  • 6
  • 58
  • 76
  • Excuse me can you get me the equivalent of this code in objective c with example , i appreciate your effort – wod Dec 20 '11 at 11:05