objective c - How can I implement a text parsing/tokenising interface similar to the way Xcode highlights class names? -


i new cocoa , objective c please forgive me if dumb or obvious question. i'd grateful pointers right classes read documentation or existing web resources me figure out. willing hard work figuring out if can find suitable resources point me in right direction.

i writing app that, essentially, contain text view user enter multi-line text. parsed (i'm thinking of using nsscanner or, maybe, ready-made stuff in parsekit) extract , tokenise words , numerical information stored in model object.

i think can figure out parsing , data-storage stuff. however, tokenised words , numbers highlighted user can see them, change them , have contextual menu (with disclosure triangle) perform actions such ignoring them. ideally lot way xcode deals class names (underlining them dashed line, giving them menu etc).

i've had @ nstokenfield seems suited single-line fields , big blue tokens bit visually disruptive want. also, docs seem suggest using plain text style allows 1 token per field couldn't mix style effect i'm after.

i've had @ text attachment attributes can't quite conceptualise whether right way go. so, questions are:

  1. what best way tokenise text within multi-line text view?
  2. is possible implement custom visual style tokens? can existing classes or need create own?

watch wwdc sessions on cocoa text system. class want understand nslayoutmanager.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -