Passing data between storyboards with no segue

Herahadi

Hello I have two story boards. Lets call them storyboard1 and storyboard2.

I want to pass data from storyboard1 to storyboard2, and here is my code.

In storyboard1:

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"IndicesDetail" bundle:nil];
DataIntegrationIndexDetailViewController *cl =   (DataIntegrationIndexDetailViewController *)[sb instantiateViewControllerWithIdentifier:@"indicesDetail"];

cl.transitioningDelegate = self;

[self presentViewController:cl animated:YES completion:nil];

and in storyboard2, I called the value something like this:

NSLog(@"sel index:%@",_delegate.selectedIndexCode);

the result I got is null.

I also try like this, in storyboard1:

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"IndicesDetail" bundle:nil];
DataIntegrationIndexDetailViewController *cl = (DataIntegrationIndexDetailViewController *)[sb instantiateViewControllerWithIdentifier:@"indicesDetail"];

cl.selectedIndex = @"test";

[self presentViewController:cl animated:YES completion:nil];

But it's give me an error.

So how I pass data from one storyboard to another storyboard?

Dody Rachmat Wicaksono

Try:

[self.navigationController pushViewController:cl animated:YES]; 

instead of [self presentViewController]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Passing data between View Controllers using Segue

From Dev

Passing Data between View Controllers without segue

From Dev

iOS:passing data between two UITableViewController using storyboards

From

What is the difference between Modal and Push segue in Storyboards?

From

Passing data with unwind segue

From Dev

Passing data with segue in the tableViewCell

From Dev

Passing data with segue

From Dev

Passing data through Segue

From Dev

Passing variables between Storyboards without Segues - Swift

From Dev

Can an 'Unwind Segue' work between two storyboards connected by a storyboard reference?

From Dev

Passing data with segue through TabBarControllerController

From Dev

Passing data with segue through navigationController

From Dev

Swift: Prepare for segue not passing data

From Dev

Passing Data between view Controllers Using a segue from a view embedded in a navigation controller to a tabbarcontroller

From Dev

Swift one out of three segue is not passing data

From Dev

Passing data with segue from UITableView to UIViewController

From Dev

Passing data from modal segue to parent

From Dev

Passing custom data with map pin segue

From Dev

Passing data on segue to view controller (Swift)

From Dev

How to get json data for passing it by segue

From Dev

Passing data to new ViewController through Segue

From Dev

iOS Delegates instead of passing data through a segue

From Dev

How to change the segue type of the storyboards

From Dev

Create and perform segue without storyboards

From Dev

Passing data between scenes

From Dev

Passing data between the fragments

From Dev

Passing data between middelware

From Dev

Passing data between views?

From Dev

Passing Data between middlewares

Related Related

  1. 1

    Passing data between View Controllers using Segue

  2. 2

    Passing Data between View Controllers without segue

  3. 3

    iOS:passing data between two UITableViewController using storyboards

  4. 4

    What is the difference between Modal and Push segue in Storyboards?

  5. 5

    Passing data with unwind segue

  6. 6

    Passing data with segue in the tableViewCell

  7. 7

    Passing data with segue

  8. 8

    Passing data through Segue

  9. 9

    Passing variables between Storyboards without Segues - Swift

  10. 10

    Can an 'Unwind Segue' work between two storyboards connected by a storyboard reference?

  11. 11

    Passing data with segue through TabBarControllerController

  12. 12

    Passing data with segue through navigationController

  13. 13

    Swift: Prepare for segue not passing data

  14. 14

    Passing Data between view Controllers Using a segue from a view embedded in a navigation controller to a tabbarcontroller

  15. 15

    Swift one out of three segue is not passing data

  16. 16

    Passing data with segue from UITableView to UIViewController

  17. 17

    Passing data from modal segue to parent

  18. 18

    Passing custom data with map pin segue

  19. 19

    Passing data on segue to view controller (Swift)

  20. 20

    How to get json data for passing it by segue

  21. 21

    Passing data to new ViewController through Segue

  22. 22

    iOS Delegates instead of passing data through a segue

  23. 23

    How to change the segue type of the storyboards

  24. 24

    Create and perform segue without storyboards

  25. 25

    Passing data between scenes

  26. 26

    Passing data between the fragments

  27. 27

    Passing data between middelware

  28. 28

    Passing data between views?

  29. 29

    Passing Data between middlewares

HotTag

Archive