Hello guy's and girl's,
I got a question, i'm new to objective c and iphone apps. But i'm trying to make a few simple applications but i have trouble with creating a segue that also sets the label in the next view controller.
The situation is as following. i have a Tableviewcontroller with an loaded nsarray of data. Next i have created a segue (ctrl + drag). Al works so far. Now the viewcontroller has an label, i have namend the segue and a'm trying the following code.
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"ShowTitleInOtherViewController"]) {
PracticeViewController *pvc = [segue destinationViewController];
pvc.labelForDisplayData.text = @"Segue complete";
pvc.labelForDisplayData.textColor = [UIColor blueColor];
pvc.labelForDisplayData.font = [UIFont boldSystemFontOfSize:50];
}
}
i have imported the header and the viewcontroller header looks like the following:
@interface PracticeViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *labelForDisplayData;
@end
Please tell me what i am doing wrong. (there are no error's)