按关键字不区分大小写高亮标记搜索内容方法

//不区分大小写

NSRangerange = [model.messageContentrangeOfString:textoptions:NSCaseInsensitiveSearch];

NSMutableAttributedString*str = [[NSMutableAttributedStringalloc]initWithString:model.messageContent];

[straddAttribute:NSForegroundColorAttributeNamevalue:COLOR_LIGHTrange:range];

[self.sizeORmessageLabelsetAttributedText:str];

你可能感兴趣的:(按关键字不区分大小写高亮标记搜索内容方法)