My target is to show cents as a superscript with small font in blue color. I am doing the following
self.superScript = @"8899";
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:self.superScript];
UIFont *font = [UIFont systemFontOfSize:18.0f];
UIFont *smallFont = [UIFont systemFontOfSize:9.0f];
[attString beginEditing];
[attString addAttribute:NSFontAttributeName value:(font) range:NSMakeRange(0, self.superScript.length - 2)];
[attString addAttribute:NSFontAttributeName value:(smallFont) range:NSMakeRange(self.superScript.length - 2, self.superScript.length - 2)];
[attString addAttribute:(NSString*)kCTSuperscriptAttributeName value:@"2" range:NSMakeRange(self.superScript.length - 2, self.superScript.length - 2)];
[attString addAttribute:(NSString*)kCTForegroundColorAttributeName value:(id)([[UIColor blueColor] CGColor]) range:NSMakeRange(self.superScript.length - 2, self.superScript.length - 2)];
[attString endEditing];
self.amount.attributedText = attString;
However what i am getting is and the superscript is not in blue.
Any thoughts about this one.