I have label in my secondviewcontroller. I would like to pass button index from firstviewcontroller to secondviewcontroller label. When I press button, it goes to second viewcontroller but label is nil
// FirstViewController.m
NSInteger index = [carousel indexOfItemViewOrSubview:sender];
int ind=index;
SecondViewController *sVC = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
sVC.myLabel.text=[NSString stringWithFormat:@"%d",ind];
[self presentModalViewController:sVC animated:YES];
//SecondViewController.h
@property (strong, nonatomic) IBOutlet UILabel *myLabel;
//SecondViewController.m
@synthesize myLabel;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSLog(@"%@",myLabel.text);
}