-2
-(IBAction)btn:(id)sender {

    abcViewController *vc = [[abcViewController alloc]initWithNibName:@"abcViewController" bundle:nil];
    vc.str = @"hello";
    [self.navigationController pushViewController:vc animated:YES];
}
Achrome
  • 7,773
  • 14
  • 36
  • 45
  • 2
    possible duplicate of http://stackoverflow.com/questions/8429088/ios-storyboard-passing-data-navigationviewcontroller – Ashwin P Jun 17 '15 at 10:08

2 Answers2

0

Check out this code

UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"identifierName"];
vc.label = @"Text";
[self.navigationController pushViewController:vc animated:YES];

Rajesh Maurya
  • 3,026
  • 4
  • 19
  • 37
0

Suppose you want to send string value from one view to another using storyboard. In first view controller declare the variable in .h file like NSString str; and in second view controller declare the variable in .h like NSString newStr;. Then in first view controller of .m file create second view object using storyboard - SecondViewController *svc = [storyboard instantiateViewControllerWithIdentifier:@"SecondViewController"]; And send variable using this object to second view- svc.newStr = str;