Syntax Highlighting Prob - Adding Other Colors.
Syntax Highlighting Prob - Adding Other Colors.
- Subject: Syntax Highlighting Prob - Adding Other Colors.
- From: Oliver Cameron <email@hidden>
- Date: Sat, 10 May 2003 22:40:26 +0100
Hey guys,
Hope you can give me some help with this code.
while (area.length) {
found = [string rangeOfString:@"Mike"
options:NSCaseInsensitiveSearch
range:area];
if (found.location == NSNotFound) break;
[textStorage addAttribute:NSForegroundColorAttributeName
value:blue
range:found];
area.location = NSMaxRange(found);
area.length = length - area.location;
This code is part of a bigger piece (obvious). What I want to succeed
with is, adding another color, and text. I know I need to use if, else
if etc. But, I've tried and just can't figure it out. So to summarize,
say I want the word George in red, how would I do that? Currently I
have Mike in blue. I would really appreciate the help!
Thanks again!
Oliver
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.