1

I want to create uitabbarviewcontroller programmatically for my application.

In that uitabbarcontroller, i want to add 2 buttons namely "Show Log", "My Contacts".

when tapping on that "ShowLog" button , i want to push new view and the same for "My Contacts" button also

I dont know how to do that

Please help me below is the code i have tried

myTabBarController = [[UITabBarController alloc] init];
myTabBarController.view.frame = CGRectMake(0, 0, 320, 460); 


MyCallLogViewController *testVC = [[MyCallLogViewController alloc] init];
TemplateViewController *otherVC = [[TemplateViewController alloc] init];    


NSArray* controllers = [NSArray arrayWithObjects:testVC, otherVC, nil];

myTabBarController.viewControllers = controllers;



// Add the tab bar controller's current view as a subview of the window

[self.view addSubview:myTabBarController.view];
user198725878
  • 6,266
  • 18
  • 77
  • 135
  • Actually when run the above code it shows the detailview initially.i dont wnat this behaviour waht i need is simply show uitabbarcontoller. then when i tap on it , i want to push a view – user198725878 Dec 14 '11 at 09:59

0 Answers0