• 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
Remembering the state of an NSScrollView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Remembering the state of an NSScrollView?


  • Subject: Remembering the state of an NSScrollView?
  • From: Nick Zitzmann <email@hidden>
  • Date: Thu, 8 Feb 2007 17:06:47 -0700

I searched the archives and didn't see any answers to the following question...

I need the current scroll location of an NSScrollView to be remembered between launches. The scroll view contains a view that is scrolled only vertically. Currently I'm getting the position of the scroll view like this:

return [[[myView enclosingScrollView] contentView] bounds].origin;

Then I save the results to user defaults, and reload it like this:

[myView scrollPoint:aPoint];

This is called _after_ the view is resized to the size it was when we saved its state. The problem is, either the scroll point calculation when saving the view is way off, or -scrollPoint: is sending it to the wrong place. Either way, when I scroll halfway through the view and then have it save its state, when restoring it it's scrolled all the way to the bottom.

Has anyone done something like this before? If so, then what worked for you?

Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Remembering the state of an NSScrollView?
      • From: Dominik Pich <email@hidden>
  • Prev by Date: Re: NSProgressIndicator bug report
  • Next by Date: how to use the "small icon menu" in the main menu bar?
  • Previous by thread: Something's leaking... [NSFileHandle availableData] maybe?
  • Next by thread: Re: Remembering the state of an NSScrollView?
  • Index(es):
    • Date
    • Thread