Re: Autolayout error with NSSplitView When Divider Programmatically Moved
Re: Autolayout error with NSSplitView When Divider Programmatically Moved
- Subject: Re: Autolayout error with NSSplitView When Divider Programmatically Moved
- From: Darren Wheatley <email@hidden>
- Date: Sun, 10 Nov 2013 23:23:11 +0000
Hi,
After your reply I went back to the code and picked through everything
again step by step.
Looking into it I found I still had the base SDK set to 10.8 on one of
the projects in the workspace. I fixed that, and manually wiped the
Derived Data folder, and now it works fine.
No code changes.
Thanks for taking the time to look into this for me.
Regards
Darren.
On 10/11/2013 02:54, Kyle Sluder wrote:
On Nov 9, 2013, at 4:04 PM, Darren Wheatley <email@hidden> wrote:
I have a 10.7 app built on 10.9. I'm debugging on 10.9.
My main view has a splitView with two panes: a webview in one, and an NSScrollView in the other.
When the app starts I programmatically move the divider to the right to hide the right-hand pane and the enclosed NSScrollView.
When this happens I get this warning in the console:
“"Layout still needs update after calling -[NSScrollView layout]. NSScrollView or one of its superclasses may have overridden -layout without calling super. Or, something may have dirtied layout in the middle of updating it. Both are programming errors in Cocoa Autolayout. The former is pretty likely to arise if some pre-Cocoa Autolayout class had a method called layout, but it should be fixed.”"
This only happens when the view is first loaded when the app starts. Switching away to a new view, and back, is fine.
I think the problem is that the scroll view is still being drawn when I move the splitView divider, causing the scrollview to be dirtied.
In Cocoa, “still being drawn” is synonymous with “inside -drawRect: or a method that is called by it,” so the only way that drawing could be at fault here is if you are somehow triggering your split view adjustment from some view’s -drawRect:, which has always been an error.
Are you sure the scroll view that is complaining is the one you created, and not the one embedded in the WebView?
--Kyle Sluder
--
Darren Wheatley
Director
Tenjin Consulting Limited (06148745)
PO Box 3230, Swindon, Wiltshire, SN5 5US
Email: email@hidden
Tel: +44 7796 124 328
Fax: +44 7092 000 711
Registered Address: 43-45 Devizes Road, Swindon, Wiltshire, SN1 4BG
_______________________________________________
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