0
votes

My app works perfectly on the simulator, but not on my iPad. I have a UILabel (created programatically) that displays an NSAttributedString. The label itself appears, but the string won't display on the device (but works on simulator). I have confirmed through testing that the label will display a normal NSString, and I have also confirmed that if I create a UILabel with Interface Builder I can display attributed text in it.

The UILabel itself is a property of my view controller, declared with (strong, nonatomic).

I'm fairly new at this, so dumb mistakes are possible. Any idea what could be wrong?

Thanks.

1
Please share some of your current code so people can better help you. - Miklos Aubert

1 Answers

0
votes

I found the answer. It had nothing to do with UILabel or NSAttributedString. Turns out that the text files were not properly loading on my device, because the name of the file was capitalized in the bundle but not capitalized in my code. It worked on simulator because (it turns out) simulator does not care about file capitalization, but my device does. Once I got the text file to load, everything displayed as expected.