Re: NSLayoutManager and avoiding widows and orphans
Re: NSLayoutManager and avoiding widows and orphans
- Subject: Re: NSLayoutManager and avoiding widows and orphans
- From: Martin Wierschin <email@hidden>
- Date: Tue, 6 Nov 2007 17:24:04 -0800
Hi Keith,
So, next I tried waiting until all layout is complete and then
enumerating through the text containers, checking for a widow or
orphan at the end of each one, adjusting the frame and then forcing
layout. But again, if a page gets added because of this, we hit
problems - bounds and run storage exceptions, and problems caused
by adding a text container whilst enumerating through the text
containers.
Do you trigger this frame adjusting from the NSLayoutManager delegate
methods? In my experience it is not safe to modify text container
geometry/size from this callback. Try this and see if it fixes your
crash: after you detect that layout has completed schedule your
fixing code via "performSelector:withObject:afterDelay:".
~Martin
_______________________________________________
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