Search Results

Search found 2 results on 1 pages for 'lyonjtill'.

Page 1/1 | 1 

  • 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

    Read the article

  • UILabel not changing when method called

    - by LyonJTill
    - (IBAction)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:[NSString stringWithFormat:@"%@",examName]]; } Hey all, Basically above is the method that is being called when one ViewController is being close and another is being opened the problem is, is that the UILabel in the new ViewController isn't changing to the value i need it to? Any ideas? Regards Lyon J Till

    Read the article

1