• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Syntax Highlighting Prob - Adding Other Colors.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Syntax Highlighting Prob - Adding Other Colors.
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: Re: Precompiled header woes
  • Next by Date: Re: Precompiled header woes
  • Previous by thread: Re: Force to show ToolTip
  • Next by thread: Re: Syntax Highlighting Prob - Adding Other Colors.
  • Index(es):
    • Date
    • Thread