UA-17470720-3

Jump to content


Photo
* - - - - 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

alphaai

    Sr. Member

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

Posted 20 March 2013 - 11:39 PM

Hello,

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?
THanks,

Ben

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
Popular

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.

HTH
  • Tarek likes this
Cheers,

Dave

www.dgapps.ie




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users