UITextView font is nil

Try checking the “selectable” checkbox for this UITextView in Interface Builder. It’s in the Attributes Inspector. Per @VahramDodoryan’s comment below, you can then set selectable to false if you don’t want to support selection.

I can’t explain why this works, but it’s probably a UIKit bug. I had an IBOutlet to a UITextView whose font property was nil, and it would not respond to any font or text-color changes in code until after its text property had been set. I arrived at this solution through trial-and-error.


If you’re still encountering this issue on recent releases of iOS, consider opening a radar:

  • https://openradar.appspot.com/15854592
  • https://openradar.appspot.com/15196932

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)