Re: Possible causes of "attempted layout while textStorage is editing"?
Re: Possible causes of "attempted layout while textStorage is editing"?
- Subject: Re: Possible causes of "attempted layout while textStorage is editing"?
- From: Martin Wierschin <email@hidden>
- Date: Wed, 31 Aug 2011 15:02:24 -0700
> _fillLayoutHoleForChar acterRange:desiredNumberOfLines:isSoft: *** attempted layout while textStorage is editing. It is not valid to cause the layoutManager to do layout while the textStorage is editing (ie the textStorage has been sent a beginEditing message without a matching endEditing.)
...
> I have not called begin editing or end editing at all, and there are no unmatched begin and end editing calls in my code, and there are no other threads editing the text storage. Nothing that I can see that would trigger this.
That might be, but perhaps the begin/end editing calls are made for you automatically as part of some bigger operation your code (or the user) requested. For example, it might be that Apple's implementation of -[NSTextView changeFont:] wraps its changes in begin/end editing.
> The offending line of code is:
>
> [layoutManager glyphRangeForTextContainer:[[layoutManager textContainers] firstObject]];
When are you requesting this layout exactly? Can you post the full backtrace for the exception?
I'd ask the user to submit a recent console log to see if there have been any other errors. It could be that an earlier exception is unwinding the stack during text storage editing, leaving the storage in its invalid state. You might also make sure the user isn't running any text system haxies.
~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