Syntax highlighting? (for the creator or those who know!)

I’m creating an app for the iPad for objective c coding on the go. Not to make this sound weird but I’d love to be pointed in the right direction to implant syntax highlighting or possibly code completion.
If possible could the admin email me (if possible?)

I didn’t post this on stack overflow because they aren’t as nice as you codea’s

I’m not an admin but dug up this via google search

Not sure if it’s of use but perhaps you might get something out of it.

Thanks but Objective C is just a tiny bit (tiny) like Visual Basic C. I’m going to keep searching.

Apple needs to implant a JS like text finding…

@TD2 the Codea editor is implemented using a UITextView. The highlighting is done by overlaying subviews in the appropriate positions — usually UILabels. They are dequeued from a re-use pool, similar to the way UITableViewCells work. During scrolling, the lines requiring re-highlighting pull markers out of the pool and lines that have moved off screen dump their markers back into the pool.

There are other ways to do syntax highlighting, however. There is a WWDC video from 2011 that shows how to achieve it using a UIWebView with javascript. This way is probably more straightforward and I know a developer who has used this method for a LaTeX editor.

Code completion is just performed by analysing the current word and displaying a view containing completions on the UIInputAccessoryView. This is just hooking into the selectionChanged method on the UITextView delegate. A similar thing could be done with a webview-based solution as well.

Hope this helps!

The Textastic app uses TextMate-compatible .tmbundle packages and .tmTheme files for syntax highlighting (and it supports objective C).

Thanks Simeon!
Your way sounds quite memory intensive, (mine’s much cruder using a UIWebView with alpha 0.5) I think I’ll search for the WWDC 11 cast.

Ugh, can’t find it… /whiney 5yr old voice/ Link please?