Saving position in NSTextView
Saving position in NSTextView
- Subject: Saving position in NSTextView
- From: Pascal Harris <email@hidden>
- Date: Fri, 4 Dec 2009 17:30:38 +0000
I am writing an application which, amongst other things, can be used to read text files. These text files are rather long (could be more than 1MB), which isn't convenient for anyone to read in one sitting. The text files are not editable. I would like to be able to save the position in the text file so that a reader can come back to file at a later time and not have to hunt for the last sentence that they read.
My research shows that I can do half of what I need using NSRange - using scrollRangeToVisible it seems that I can scroll to a given range (allowing the reader to resume where they left off). Sadly, I can't work out how I can save a range without the reader selecting text in the window first (hardly user friendly!). I need this to work invisibly - i.e. the user closes the window, or the app, and when the window is reopened Presto! the window contains the same view of the text as it did previously.
Perplexed. Any help that you can provide would be most welcome. _______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden