I am using Xcode 4.3.1. I have created the UI using Storyboard which has many View Controllers.
Issue
In my app i am usin
You can pass the data explicitly and in storyboard that is with the prepareForSegue call.
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([[segue identifier] isEqualToString:@"ContactsViewControllerSegue"]){
ContactsViewController *cvc = (ContactsViewController *)[segue destinationViewController];
cvc.contacts = self.contacts;
cvc.delegate = self;
}
}
For a full tutorial check out this website.
To programmatically trigger the segue you can check the Apple Docs, but here is their example on orientation change.
- (void)orientationChanged:(NSNotification *)notification
{
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
if (UIDeviceOrientationIsLandscape(deviceOrientation) &&
!isShowingLandscapeView)
{
[self performSegueWithIdentifier:@"DisplayAlternateView" sender:self];
isShowingLandscapeView = YES;
}
// remainder of example omitted....
}
So you will trigger the segue when shaking stops, and then prepare the next viewController in the prepareForSegue method.
You need to create string object in SecondViewController and set Property(nonatomic,retain) and synthesize it and after below code add when you push controller.
SecondViewController *objSecondViewController=[[SecondViewController alloc]
initWithNibName:@"SecondViewController" bundle:nil];
objSecondViewController.strtitle=@"Your data";
[self.navigationController pushViewController:objSecondViewController animated:YES];
[objSecondViewController release];