NSScrollView: copy on scroll ineffective.

Discussion in 'Mac Programming' started by jeanlain, Aug 23, 2012.

  1. jeanlain macrumors 65816

    Mar 14, 2009
    Hey, I'm writing a little app that I'd like to turn into a quickook plugin for viewing DNA sequences traces (such as these) from the Finder. I code as a hobby and this is my first xCode project, so be nice. ;)

    I embedded the document view in an NSScrollView in IB (Xcode 4.4) and set the frame.size of the document view to be the size of the document (length of trace).
    Scrolling works as intended, but isn't smooth. "Copy on scroll" (as set in IB) doesn't have any effect, so I suppose it doesn't work for some reason.
    If I read the documentation, copyOnScroll is a method of NSClipView. I haven't set an NSClipView in IB, but I suppose this was done behind the scene when I embedded the document view inside the scroll view (the Apple documentation isn't quite clear on this). Otherwise it wouldn't make sense to offer a checkbox for "copy on scroll" in the scroll view attribute inspector (copyOnScroll is not a method of NSCrollView).

    I also made sure that the scroll view draws its background (not doing so disables copy on scroll).

    What am I missing? :confused:
  2. Starfox macrumors 6502


    Apr 7, 2011
    Why not post the project to GitHub or BitBucket and have people take a look at it in its entirety? I did this with my OS X learning projects and it helped me a lot.
  3. jeanlain thread starter macrumors 65816

    Mar 14, 2009
    In fact I solved the problem with more parsimonious drawing.

Share This Page