Jump to content

* - - - - 1 votes

How to do I load another UIViewController when I click a UIToolBar button?

  • Please log in to reply
1 reply to this topic

#1 alphaai


    Sr. Member

  • STV 3.0 Pro
  • PipPipPip
  • 41 posts
Reputation: 11

Posted 20 March 2013 - 11:39 PM


I am trying to create a settings page so that users can edit their settings. Could you show me how I would implement a settings view controller using SCViewController allowing me to navigate to the settings and back again, launching from UIToolBarButton. Must be using core Data as well.

I am eliminated the tabBarController and have replace it with a simple UIToolBar which suits me as there should be only two SCViewControllers. the main page and settings. So when i click on the UIToolBar button, my settings page occurs. When I press ok or save changes, i am taken back to the main page.

I understand that I would have to create an SCEntityDescription for the data im trying to save and so on. Any ideas how I would launch other SCViewControlllers?


Edited by alphaai, 20 March 2013 - 11:40 PM.

#2 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 545 posts
  • LocationIreland
Reputation: 137

Posted 21 March 2013 - 06:54 AM

Hi alpha,

You launch a SCViewController the same way you'd launch a UIViewController.

- (IBAction)showInfo:(id)sender
    FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideViewController" bundle:nil];
    controller.delegate = self;
    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentViewController:controller animated:YES completion:nil];

That code is taken directly from the Apple utility app template. Just make the FlipsideViewController a subclass of SCViewControlller.

  • Tarek likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users