title: how can i change color of part of uilabel string with some generic method?
body: <p>can anyone tell me how can i change the color of part of uilabel string with some generic method??</p>
  
  <p>let me explain ..</p>
  
  <p>i have label like </p>
  
  <pre><code>  "10/05/2008 4 years",
    "10/05/2011 2 years",
    "20/06/1933 - 07/07/1970 37 years",
    "10/05/1982 30 years",
    "10/05/2008 4 years",
    "10/05/2011 2 years",
    "20/06/1933 - 07/07/1970 37 years"
  </code></pre>
  
  <p>now what i want is to make years and its value e.g(4 years) in diffrent color and date in diffrent color with difrent font.</p>
  
  <pre><code>NSMutableAttributedString * string = [[NSMutableAttributedString alloc]initWithString:peopleDate.text];
      [string addAttribute:NSForegroundColorAttributeName value:GraycolorForText range:NSMakeRange(10, 5)];
      [peopleDate setAttributedText:string];
  </code></pre>
  
  <p>this will just change the color with in the particular range and its not generic..so can any one please give me any solution??</p>