2

Since a few days, I have a crash that only happens in iOS with the following line of code

[myAttributedString addAttribute:NSFontAttributeName
                                             value:[UIFont fontWithName:@"HelveticaNeue-Italic" size:myLabel.font.pointSize]
                                             range:rangeOfSubString];

The reason given by debugger is

"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value'" Exception Type: SIGABRT

I know from the documentation that it's the value that's nil. Any idea why [UIFont fontWithName:@"HelveticaNeue-Italic" size:myLabel.font.pointSize] would return nil in iOS 7.0.3? (it was working perfectly well in iOS 7.0.2)

Matthieu Rouif
  • 2,843
  • 1
  • 19
  • 28
  • 1
    Exactly, HelveticaNeue Italic doesn't exist in iOS 7.0.3. Just debugged and check that it was the problem – Matthieu Rouif Nov 12 '13 at 19:54
  • 1
    Note: If you break up the calls the errors become easier to spot. Rely on the compiler optimization in the release build to remove unnecessary/redundant code. Write the code for people to **easily** understand. – zaph Nov 12 '13 at 19:58

1 Answers1

9

That typeface of Helvetica neue seems to be missing

http://www.kateva.org/sh/?p=16961

vikingosegundo
  • 52,040
  • 14
  • 137
  • 178