NSString not showing in UILabel

My NSString does not show in my UILabel.

- (void)viewDidAppear:(BOOL)animated {

    [super viewDidAppear:YES];

    PFUser *user = [PFUser currentUser];
    NSString *schoolString = user[KEY_SCHOOL];
    NSLog(@"%@", schoolString);
    school.text = [NSString stringWithFormat:@"%@", schoolString];

}

NSLog does return a valid result. My label is connected properly in IB and everything as well.

Very odd bug.

Answers


Make sure you have IBOutlet connected for this UILabel. Check UILabel is initiated or not. Try to NSLog the school.


Since your NSLog is not returning a valid result it means that the value you're setting schoolString to is invalid (probably nil). It's likely an issue with your PFUser object instead. Make sure user[KEY_SCHOOL] is returning the result you want.

Perhaps you need to use [user objectForKey:KEY_SCHOOL] instead.


Need Your Help

How to execute a bat file from cygwin bash that uses the Windows find command

batch-file cygwin

The find command does completely different in Windows and Unix. On Windows it is a fgrep-like utility listing matching lines in a file; on Unix -- and on Cygwin -- it list filenames matching some

how to have fixed with list or anchor element in html?

html css

I have website with list and anchor links.