Re: Responsive scrolling: prepareContentInRect: not called
Re: Responsive scrolling: prepareContentInRect: not called
- Subject: Re: Responsive scrolling: prepareContentInRect: not called
- From: Antonio Nunes <email@hidden>
- Date: Wed, 08 Oct 2014 11:53:57 +0200
On 08 Oct 2014, at 01:41, Ken Thomases <email@hidden> wrote:
>> Wondering if anyone has an idea of why prepareContentInRect: is not called for a view when responsive scrolling is enabled.
>>
>> We are using an NSScrollView subclass that overrides prepareContentInRect:.
>
> I would not expect -prepareContentInRect: to be called on the scroll view. It would be called on the document view (and its subviews?). The purpose is to allow the document view to prepare itself for the requests to draw the overdraw region. The scroll view itself is not drawn in the overdraw region. Likewise, I would not expect the scroll view's -drawRect: to be called for overdrawing.
Thanks for your suggestions Ken,
Indeed we do not ‘drawRect:’ anything in the scroll view. :-)
>> (I have tried overriding prepareContentInRect: in the NSScrollView’s subclass, as well as in the view that serves as the scroll view’s document view. Neither of these methods gets called though.)
>
> I would double-check that, in the occasions when you overrode -prepareContentInRect: in the document view, you didn't also accidentally disable responsive scrolling. Also, make sure your override calls through to super and doesn't unintentionally stop AppKit from further extending the overdraw region by passing the same rect in successive calls.
Turns out the problem is a different, and of course, almost embarrassingly silly one. I misspelled the method name: prepareContentInrect rather than prepareContentInRect. Now that I’ve caught that and corrected it, the method is called. Thanks for you effort anyway.
-António
_______________________________________________
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