I need to get text from text files and put it in a non-editable NSTextView. How can I accomplish this?
Asked
Active
Viewed 551 times
0
-
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 Answers
2
- Load the file into an NSString.
- Set the NSTextView's string to the loaded string (hint: NSTextView is a subclass of NSText).
- 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