title: FontAwesomeKit - 'NSInvalidArgumentException' iOS 7.1.1
body: <p>I'm using cool lib <strong>FontAwesomeKit</strong> (<a href="https://github.com/PrideChung/FontAwesomeKit" rel="nofollow">https://github.com/PrideChung/FontAwesomeKit</a>) for my new iOS app. But I'm stuck with strange exception it's throwing only on Release mode and my iPhone with iOS 7.1.1.</p>
  
  <p>It looks like:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
  reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value'
  </code></pre>
  
  <p>When I test in simulator (both DEBUG and RELEASE) and iPhone (DEBUG) everything works fine, iPhone (RELEASE) crashes.</p>
  
  <p>This workaround didn't help - <a href="https://github.com/PrideChung/FontAwesomeKit/blob/master/KnownIssues.md" rel="nofollow">https://github.com/PrideChung/FontAwesomeKit/blob/master/KnownIssues.md</a></p>
  
  <p>Thanks!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The problem was in my code and <code>__weak</code> reference:</p>
  
  <pre><code>__weak UIColor *menuColor = [UIColor colorWithHexString:@"#636577"];
  __weak UIColor *menuColorHover = [UIColor colorWithHexString:@"#3D3F52"];
  CGFloat icon_size = 25.5f;
  
  for (UIButton *button in self.buttons) {
      if ([button.titleLabel.text isEqualToString:@"Feed"]) {
          FAKFoundationIcons *feedIcon = [FAKFoundationIcons homeIconWithSize:icon_size];
  
          [feedIcon addAttribute:NSForegroundColorAttributeName value:menuColor];
          [button setImage:[feedIcon imageWithSize:CGSizeMake(icon_size, icon_size)] forState:UIControlStateNormal];
  
          [feedIcon addAttribute:NSForegroundColorAttributeName value:menuColorHover];
          [button setImage:[feedIcon imageWithSize:CGSizeMake(icon_size, icon_size)] forState:UIControlStateHighlighted];
      }
  </code></pre>