0

Here's the issue: I have a view controller with a segmented control and want to send data from segment A to segment B using a button. At the same time, I need to make segment B active and call a method there. At segment A my data is on a tableView, I need to send only one value from one cell to the other segment.

I seem to be stuck in this for a while. Tried to send the data from the child to parent to child and tried child to child but always crash the app.

Leo
  • 1
  • 1
  • When you click on a button, first get data that you want to pass. Then create a class method in Segment B controller. Now set your segment's selectedIndex to B's index and call newly created class method with parameters. This will show Segment B on screen and call your method as well – rushisangani Jan 19 '16 at 13:05

1 Answers1

0

You first need to create an IBOutlet (reference) of the segmented controller and then catch the changed value in the code by creating a corresponding method with IBAction and linking it again to the controller. Check this tutorial on how to set it all up http://www.ioscreator.com/tutorials/create-segmented-control-ios7

Bretsko
  • 608
  • 2
  • 7
  • 20