title: NSMutableAttributedString strange behaviour when setting NSForegroundColorAttributeName
body: <p>I am trying to set the colour of text in an <code>NSMutableAttributedString</code>. I have a base class called <code>SectionTitleLabel</code>:</p>
  
  <pre><code>@implementation SectionTitleLabel
  
  + (void)initialize
  {
      [[self appearance] setTextColor:[UIColor whiteColor]];
      [[self appearance] setFont:[UIFont fontWithName:kFontBold size:16.0f]];
  }
  
  @end
  </code></pre>
  
  <p>I have created a custom class which inherits from the above base class and have a method called addAttributes.</p>
  
  <pre><code>@interface PLSLabel : SectionTitleLabel
  
  - (void)addAttributes:(NSArray *)words;
  </code></pre>
  
  <p>And in the implementation I have the following code:</p>
  
  <pre><code>- (void) addAttributes:(NSArray *)words
  {
      self.words = words;
  
      [self setTextColor:[UIColor whiteColor]];  // When this line is taken out the attributed text is not applied.
  
      for (NSString *word in self.words) {
           NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithAttributedString:self.attributedText];
          NSRange range = [self.text rangeOfString:link];
          NSLog(@"TEST TEST: %@", link);
  
          [attributedText addAttributes:@{NSForegroundColorAttributeName : [UIColor blueColor]} range:NSMakeRange(range.location, range.length)];
          self.attributedText = attributedText;
      }
  }
  </code></pre>
  
  <p>If I take out the following line from the addAttributes method 
  <code>[self setTextColor:[UIColor whiteColor]];</code> then it doesn't work. As in the text remains completely white.</p>
  
  <p>However when I have that line in the code then it works as expected (i.e: The words passed into the method become blue). I am hoping that someone can explain why this might be the case. And if it's a bug then it's good for other people to know a work around.</p>
  
  <p>Many thanks.</p>