I am using this function to switch between views in Xcode 4.3.
[self performSegueWithIdentifier:@\"NextView\" sender:self];
I would like to
Here is the answer from Pfitz, but I made it a little easier to understand for folks who are new to Objective-C using an example:
In your destinationViewController.h file add property setting for variable to 'receive' value from your source controller.m file
@property (nonatomic) int billIdReceivingVote;
Import your destinationViewController.h to your sourceViewController.m file:
// VOLViewController.m
#import "VOLVoteViewController.h
Add prepareForSegue
method to your sourceViewController.m file and pass the variables
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
VOLVoteViewController *myDestinationViewController = [segue destinationViewController];
// myDestinationViewController.variable = sourceViewController variabe
myDestinationViewController.billIdReceivingVote = [self.idOfBillSelected intValue];
}