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: "email@hidden" <email@hidden>
- Date: Thu, 01 Sep 2011 11:52:30 +0100
On 1 Sep 2011, at 07:08, Gideon King wrote:
> Here is the complete stack trace
>
> 2011-08-31 15:25:11 -0400[5]: ERROR - 14764064ms (NMApplication.m:81) -[NMApplication handleRunException:] - NSException Exception encountered: -[AAMainEditingLayoutManager _fillLayoutHoleForCharacterRange: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.)
>
> 2011-08-31 15:25:11 -0400[5]: 0 CoreFoundation 0x00007fff8b3e0986 __exceptionPreprocess + 198
> 2011-08-31 15:25:11 -0400[5]: 1 libobjc.A.dylib 0x00007fff8bb11d5e objc_exception_throw + 43
> 2011-08-31 15:25:11 -0400[5]: 2 CoreFoundation 0x00007fff8b3e07ba +[NSException raise:format:arguments:] + 106
> 2011-08-31 15:25:11 -0400[5]: 3 CoreFoundation 0x00007fff8b3e0744 +[NSException raise:format:] + 116
> 2011-08-31 15:25:11 -0400[5]: 4 AppKit 0x00007fff89f1d0bc -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] + 432
> 2011-08-31 15:25:11 -0400[5]: 5 AppKit 0x00007fff89f1ccce -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:] + 203
> 2011-08-31 15:25:11 -0400[5]: 6 AppKit 0x00007fff89f1af46 _NSFastFillAllLayoutHolesUpToEndOfContainerForGlyphIndex + 500
> 2011-08-31 15:25:11 -0400[5]: 7 AppKit 0x00007fff89f1ac5e -[NSLayoutManager textContainerForGlyphAtIndex:effectiveRange:] + 223
> 2011-08-31 15:25:11 -0400[5]: 8 AppKit 0x00007fff89f1aa42 -[NSLayoutManager glyphRangeForTextContainer:] + 304
> 2011-08-31 15:25:11 -0400[5]: 9 NovaMind5 0x000000010014453c -[AARichTextModel recalculateSize] + 1640
> 2011-08-31 15:25:11 -0400[5]: 10 NMFoundation 0x0000000100476f2f -[MAKVObservation observeValueForKeyPath:ofObject:change:context:] + 122
> 2011-08-31 15:25:11 -0400[5]: 11 Foundation 0x00007fff8b83118a NSKeyValueNotifyObserver + 387
> 2011-08-31 15:25:11 -0400[5]: 12 Foundation 0x00007fff8b852387 NSKeyValueDidChange + 486
> 2011-08-31 15:25:11 -0400[5]: 13 Foundation 0x00007fff8b7fea2f -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 130
> 2011-08-31 15:25:11 -0400[5]: 14 CoreData 0x00007fff8f7e7007 _PF_ManagedObject_DidChangeValueForKeyIndex + 103
> 2011-08-31 15:25:11 -0400[5]: 15 CoreData 0x00007fff8f7e6558 _sharedIMPL_setvfk_core + 264
> 2011-08-31 15:25:11 -0400[5]: 16 NovaMind5 0x000000010016118e -[AATopicShapeModelBase setNewWidthForMainRect:fromOldWidth:] + 2657
> 2011-08-31 15:25:11 -0400[5]: 17 NovaMind5 0x00000001001606b4 -[AATopicShapeModelBase setNewSizeForMainRect:fromOldSize:] + 130
> 2011-08-31 15:25:11 -0400[5]: 18 NovaMind5 0x00000001001882e2 -[AAMapView(mouse) resizeTopicNodeVisual:usingHandle:withEvent:] + 2287
> 2011-08-31 15:25:11 -0400[5]: 19 NovaMind5 0x0000000100187721 -[AAMapView(mouse) mouseDown:] + 5283
> 2011-08-31 15:25:11 -0400[5]: 20 AppKit 0x00007fff89f4066e -[NSWindow sendEvent:] + 6280
> 2011-08-31 15:25:11 -0400[5]: 21 AppKit 0x00007fff89ed8f19 -[NSApplication sendEvent:] + 5665
> 2011-08-31 15:25:11 -0400[5]: 22 OmniAppKit 0x0000000100574900 -[OAApplication sendEvent:] + 144
> 2011-08-31 15:25:11 -0400[5]: 23 AppKit 0x00007fff89e6f42b -[NSApplication run] + 548
> 2011-08-31 15:25:11 -0400[5]: 24 OmniAppKit 0x0000000100571774 -[OAApplication run] + 132
> 2011-08-31 15:25:11 -0400[5]: 25 AppKit 0x00007fff8a0ed52a NSApplicationMain + 867
> 2011-08-31 15:25:11 -0400[5]: 26 NovaMind5 0x0000000100001688 start + 52
> 2011-08-31 15:25:11 -0400[5]: 27 ??? 0x0000000000000002 0x0 + 2
Is it possible that the user is editing the textview when this code is triggered?
From the looks of the trace you react directly to the mouseDown event in another view which might not give NSTextView opportunity to conclude its edit.
I would schedule my layout manipulation on the runloop and see if that helps.
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com_______________________________________________
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