0

I am working on an application for IOS .I made a menu bar which contains buttons , menu bar should be on each page of application. I made many View controller scenes , I want the functionality like this : when i click on any button it should open a View controller scenes.

How to open a View controller scenes on click of button ? I don't want to add other existing View controller scenes on my current View controller scenes as a subview. I want to open other existing scenes independently.

Bhavin
  • 27,155
  • 11
  • 55
  • 94
Anupam Mishra
  • 3,408
  • 5
  • 35
  • 63
  • 1
    use custom tabbar functionality and implement as menu bar. like this http://www.martinhoeller.net/2011/05/07/custom-tab-bars/ – vamsi575kg Apr 02 '13 at 12:02
  • I already made it, now i wants to open other existing scenes on click of buttons. here it this application they are adding as a subview of current view – Anupam Mishra Apr 02 '13 at 12:08
  • @Gup OP doesn't want the other VC added as a subview. – viral Apr 02 '13 at 12:25

4 Answers4

0

1) Insert View :

ButtonView *buttonView = [[ButtonView alloc] initWithNibName:@"ButtonView" bundle:[NSBundle mainBundle]];
buttonView.view.frame = CGRectMake(yourFrame);
[self.view addSubview:buttonView.view];

2) Remove View :

[buttonView removeFromSuperview];
Bhavin
  • 27,155
  • 11
  • 55
  • 94
0

You have to look into the following

  • Navigation controller
  • Tab bar controller custom implementation
Lithu T.V
  • 19,955
  • 12
  • 56
  • 101
0

Have you tried this, just replace YourViewController with the name of the .xib you would like to load.

YourViewController *yvc = [[YourViewController alloc] init];
[self presentViewController:yvc animated:YES completion:nil];

This goes inside your IBaction for the navigation button, fyi.

tistheoc
  • 1
  • 2
0

You need to look into UINavigationController or UITabBarController. There are other ways too. The navigation controller is the easiest. Apple documentation has everything you need.

Dancreek
  • 9,524
  • 1
  • 31
  • 34