• 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: Text layout responsibility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text layout responsibility


  • Subject: Re: Text layout responsibility
  • From: chaitanya pandit <email@hidden>
  • Date: Fri, 12 Dec 2008 16:48:03 +0530

Try changing the container size once the layout is complete, you can do this by using the delegate method:
- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag
and checking the layoutFinishedFlag.


But you need to take care of not entering an infinite loop.

HTH,
Chaitanya


On 12-Dec-08, at 4:36 PM, Rimas wrote:

My first suspicion was wrong, but I think you're experiencing a similarly
touchy aspect of NSLayoutManager.


I believe the problem is that the NSLayoutManager attached to the text
storage might not have been notified of the edit before you get the
notification. So when you change the container geometry layout is triggered
for an intermediate/invalid state. In your NSTextStorageDidProcessEditing
callback try using "performSelector:withObject:afterDelay:" to schedule your
container changes and see if that fixes the problem.

Looks like delaying text container modification stops throwing exception. But I should say, this is a strange behavior. I haven't seen any notes about that in documentation. Maybe missed something.

Anyway, thank you for your help Martin.

Regards,

Rimas M.
_______________________________________________

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

_______________________________________________

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


  • Follow-Ups:
    • Re: Text layout responsibility
      • From: Martin Wierschin <email@hidden>
    • Re: Text layout responsibility
      • From: Rimas <email@hidden>
References: 
 >Text layout responsibility (From: Rimas <email@hidden>)
 >Re: Text layout responsibility (From: Martin Wierschin <email@hidden>)
 >Re: Re: Text layout responsibility (From: Rimas <email@hidden>)
 >Re: Text layout responsibility (From: Martin Wierschin <email@hidden>)
 >Re: Text layout responsibility (From: Rimas <email@hidden>)
 >Re: Text layout responsibility (From: Martin Wierschin <email@hidden>)
 >Re: Text layout responsibility (From: Rimas <email@hidden>)

  • Prev by Date: Re: Design for showing ridiculously huge number of images in Table View
  • Next by Date: More - Safari Download Security Alerts
  • Previous by thread: Re: Text layout responsibility
  • Next by thread: Re: Text layout responsibility
  • Index(es):
    • Date
    • Thread