Possible causes of "attempted layout while textStorage is editing"?
Possible causes of "attempted layout while textStorage is editing"?
- Subject: Possible causes of "attempted layout while textStorage is editing"?
- From: Gideon King <email@hidden>
- Date: Tue, 30 Aug 2011 22:12:01 +1000
I am receiving occasional reports from customers who are seeing this error:
_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.)
0 CoreFoundation 0x00007fff822847b4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff883dbf03 objc_exception_throw + 45
2 CoreFoundation 0x00007fff822845d7 +[NSException raise:format:arguments:] + 103
3 CoreFoundation 0x00007fff82284564 +[NSException raise:format:] + 148
4 AppKit 0x00007fff8192ce00 -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 643
5 AppKit 0x00007fff8192c9b0 -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:] + 211
6 AppKit 0x00007fff8192b62f _NSFastFillAllLayoutHolesUpToEndOfContainerForGlyphIndex + 679
7 AppKit 0x00007fff8192b1a5 -[NSLayoutManager textContainerForGlyphAtIndex:effectiveRange:] + 243
8 AppKit 0x00007fff81840c12 -[NSLayoutManager glyphRangeForTextContainer:] + 286
The offending line of code is:
[layoutManager glyphRangeForTextContainer:[[layoutManager textContainers] firstObject]];
(with the intention of causing layout so I can get the usedRectForTextContainer)
...but during this method, the only thing I have done is set the text container size to a user defined width (never less than 10) and a height of 1.0e7, and then called the glyphRangeForTextContainer method.
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.
I have not been able to reproduce the problem here.
I'd be interested in any suggestions of things to look for which may be triggering this error.
Thanks
Gideon
_______________________________________________
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