Help with text formatting in an NSTextView

Discussion in 'Mac Programming' started by dryjoy, Jan 5, 2012.

  1. dryjoy macrumors regular

    Mar 19, 2009
    I'm pretty inexperienced with Objective-C & Cocoa, but learning fast! I'm working on an app that needs to parse XML files, and format some text according to a few pseudo-HTML tags, such as <body>content</body> and <heading>content</heading> etc.

    I've been doing some command-line app experiments with the NSXML API (NSXMLNode, NSXMLDocument, NSXMLElement etc.) and I'm happy about reading, writing, creating, parsing etc. an XML document.

    What I'm not sure of is, once I've extracted the data from the XML document and got a tree of XML objects, how to format the text in the NSTextView, and also how to detect which ranges of text in the NSTextView are in what size, font weight etc.

    Could somebody please point me towards the appropriate classes etc, and I'll try and work it out from the Apple docs.
  2. jiminaus macrumors 65816


    Dec 16, 2010
  3. dryjoy thread starter macrumors regular

    Mar 19, 2009
    Thanks very much. I'll have a read... no doubt I'll have some specific questions once I get stuck in.

Share This Page