Banister
I myself have been looking for a nice and reliable syntax for Cocoa for a long time, and since I am creating a text editor with code code right now, this will be the main part of the project.
So, I found out that there are many Objective-C / Cocoa-other syntax-emphasizing libraries / components. For a starter (for something relatively basic, that is), I would suggest you take a look at:
However, if you really need something POWERFUL, well-tested and still Cocoa-friendly , I would definitely suggest you try the Scintilla component (for Cocoa) . The code is great, and the community (in the Scintilla-Interest Group) will happily help you hide any problems you may encounter.
In a few words:
I am currently using a large project that will be available to you, and it works great for me.
Scintilla
Scintilla is a free library that provides text editing features, with an emphasis on advanced features for editing source code. SciTE (cross-platform), Geany, Notepad ++ (Windows) and Notepad2 (Windows) are examples of stand-alone Scintilla-based editors.
Used Scintilla editing component (SciTe)

Functions
Scintilla supports many features that make editing code easier. Add syntax highlighting. . The selection method allows the use of different fonts, colors, styles and background colors , and not limited to fonts of a fixed width. The control supports error indicators , line numbering on margin, and line markers as breakpoints in the code. Other features such as code folding and autocomplete .
Dr. Kameleon
source share