0

I need to get text from text files and put it in a non-editable NSTextView. How can I accomplish this?

  • please check out this : http://stackoverflow.com/questions/1044334/objective-c-reading-a-file-line-by-line – Lailo Oct 27 '11 at 22:34
  • @lailo: There's no reason to load the text file line by line as the SO question you linked details. – Joshua Nozzi Oct 28 '11 at 00:00

1 Answers1

2
  1. Load the file into an NSString.
  2. Set the NSTextView's string to the loaded string (hint: NSTextView is a subclass of NSText).
  3. Ship BetterTextEditor.app and profit.

Prerequisite: Look up the needed methods in the two API reference documents I linked in the steps above.

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135