• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Saving position in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Saving position in NSTextView
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: NSTextView & Horizontal Scrollbar bug
  • Next by Date: Re: applicationShouldTerminate problem
  • Previous by thread: Re: NSTextView & Horizontal Scrollbar bug
  • Next by thread: Re: Saving position in NSTextView
  • Index(es):
    • Date
    • Thread