title: iOS 7 BUG - NSAttributedString does not appear
body: <p>Last week I asked a question about a Simulator bug with NSAttributedString not displaying: <a href="https://stackoverflow.com/questions/18994479/ios-7-simulator-bug-nsattributedstring-does-not-appear">iOS 7 Simulator Bug - NSAttributedString does not appear</a></p>
  
  <p>Unfortunately it now appears this is not a simulator bug but an iOS 7 bug. I have now reproduced this issue on an iPhone 5 device.</p>
  
  <p>The bug appears to be the combination of using NSUnderlineStyleAttributeName &amp; NSParagraphStyleAttributeName as attributes for a NSAttributedString.</p>
  
  <p>I have only tested on two iOS 7 devices so far, and the issue has only appeared on one of them. Even after they have both been upgraded to the exact same version:</p>
  
  <ul>
  <li><p>1st iPhone 5 with iOS 7.0 (11A465): Text does NOT appear</p></li>
  <li><p>1st iPhone 5 after upgrading to 7.0.2 (11A501): Text does NOT appear</p></li>
  <li><p>2nd iPhone 5 running iOS 7.0 (11A4449d): Text displays correctly</p></li>
  <li><p>2nd iPhone 5 after upgrading to 7.0.2 (11A501): Text does NOT appear</p></li>
  </ul>
  
  <p>So it appears Apple introduced this bug after iOS 7.0 (11A4449d). I've filed a bug with them and will update you on any response I get.</p>
  
  <p><strong>Steps to reproduce bug</strong></p>
  
  <p>If you are running iOS 7.0.2 then you should be able to reproduce this bug.</p>
  
  <p>Either download and run this project on your device <a href="https://github.com/rohinnz/iOS-7-BUG---NSAttributedString-does-not-appear" rel="nofollow noreferrer">https://github.com/rohinnz/iOS-7-BUG---NSAttributedString-does-not-appear</a></p>
  
  <p>or</p>
  
  <p>1) In Xcode 5 create a new 'Single View Application'. Call it whatever.</p>
  
  <p>2) In ViewController.m, replace the viewDidLoad method with:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      NSMutableParagraphStyle* paragraph = [[NSMutableParagraphStyle alloc] init];
      paragraph.alignment = NSTextAlignmentCenter;
  
      NSAttributedString* attrStr = [[NSAttributedString alloc] initWithString:@"Lorem ipsum dolor sit" attributes:
                                     @{NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle),
                                       NSParagraphStyleAttributeName:paragraph}];
  
      UILabel* myLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, 0, 0)];
      myLabel.backgroundColor = [UIColor greenColor];
      myLabel.attributedText = attrStr;
      [myLabel sizeToFit];
  
      [self.view addSubview:myLabel];
  }
  </code></pre>
  
  <p>3) Compile and run on your device. Depending on your version of iOS 7, the text will either display, or will not. The UILabel's background color will display in both cases.</p>
  
  <p><strong>Screenshots</strong></p>
  
  <p><strong>iPhone 5 with iOS 7.0 (11A465)</strong></p>
  
  <p><img src="https://i.stack.imgur.com/BcAqc.png" alt="iPhone 5 with iOS 7.0 (11A465)"></p>
  
  <p><strong>iPhone 5 with iOS 7.0 (11A4449d)</strong></p>
  
  <p><img src="https://i.stack.imgur.com/LvQZ8.png" alt="iPhone 5 with iOS 7.0 (11A4449d)"></p>
  
  <p><strong>My Question</strong></p>
  
  <p>Is anyone able to reproduce this issue on a device?</p>