If you're working on iOS 6 environment, you can use the attributedText
property if UITextView
.
If you're working below iOS 6, try using EGOTextView, it's a drop-in replacement with rich text editing, it haven't been supported for a year or so, so I don't really know if it'll work.
You should determine a range for which you'll apply the changes
NSRange range = [textView.text rangeOfString:searchString];
Then create the attributed string
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:textView.text];
[attrStr addAttribute:NSBackgroundColorAttributeName value:[UIColor cyanColor] range:range];
textView.attributedText = attrStr;