I have been playing around with Apple’s sample code – UserDefaults – http://developer.apple.com/library/mac/#samplecode/UserDefaults/Introduction/Intro.html – and I haven’t been able to get it working with an instance of NSTextView and by removing the record button and I was therefore wondering how to get NSUserDefaults to automatically store the contents of an NSTextView.
Thanks in advance!
There’s no way to store it automatically. Here’s a simple way to save contents by subclassing NSTextView:
EDIT
Removed
synchronize.