NSString not applying to UILabel
- by lyonjtill
- (void)restoreUserDefaults {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if([defaults objectForKey:@"Exam Name"] == nil) {
examName = [[NSString alloc] initWithString:@"Name"];
} else {
examName = [[NSString alloc] initWithString:[defaults objectForKey:@"Exam Name"]];
}
[examNameLabel setText:examName];
NSLog(@"New Exam Schedule - Exam Name - %@",[defaults objectForKey:@"Exam Name"]);
NSLog(@"examName = %@", examName);
NSLog(@"examNameLabel = %@", examNameLabel);
}
Dear all,
Basically above is a basic method to change a UILabel to a saved piece of data.
I am having a problem making the label change to the NSString examName.
I have checked Interface Builder and it's connected up.
Any ideas why?
Regards
Lyon J Till