I've been experimenting with creating a side panel menu using a library called SWRevealViewController from GitHub, and I'm trying to update a label in the main front view controller based on the name selected from the side panel tableview controller using a segue between the two to see if I could pass information between them. This is my prepareForSegue method in the TableViewController:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
if ([[segue identifier] isEqualToString:@"segueFront"]) {
ViewController *viewController = (ViewController *)segue.destinationViewController;
viewController.label.text = name;
NSLog(@"name is %@", name);
NSLog(@"label text is %@", viewController.label.text);
}
The console shows that the name variable is filled appropriately, but the viewController.label.text remains null, and the label on the ViewController storyboard doesn't get updated with the name selected from the tableview. Can you please tell me what I am doing wrong here? I have attached a copy of the project to this message as well.