Placing PlaceHolder In TextField
问题 I want to add mandatory field mark in textfield placeholder text like below image please suggest me i am totally confused how to do it 回答1: You can use : NSMutableAttributedString *attriButedString = [[NSMutableAttributedString alloc]initWithString:@"Mandatory*"]; [attriButedString addAttribute:NSForegroundColorAttributeName value:[NSColor lightGrayColor] range:NSMakeRange(0, 9)]; [attriButedString addAttribute:NSForegroundColorAttributeName value:[NSColor redColor] range:NSMakeRange(9, 1)];