• 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
Re: NSLayoutManager and avoiding widows and orphans
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSLayoutManager and avoiding widows and orphans (From: Keith Blount <email@hidden>)

  • Prev by Date: DO: Local objects passed back from the other side: Leopard vs. earlier systems
  • Next by Date: Using dot syntax for non-@property properties?
  • Previous by thread: NSLayoutManager and avoiding widows and orphans
  • Next by thread: Re: NSLayoutManager and avoiding widows and orphans
  • Index(es):
    • Date
    • Thread