Re: Text layout responsibility
Re: Text layout responsibility
- Subject: Re: Text layout responsibility
- From: Martin Wierschin <email@hidden>
- Date: Fri, 12 Dec 2008 02:29:52 -0800
Rimas,
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.
~Martin
#0 0x92811e17 in objc_exception_throw
#1 0x9071bf2b in +[NSException raise:format:arguments:]
#2 0x9071bf6a in +[NSException raise:format:]
#3 0x934598cc in _NSBlockNumberForIndex
#4 0x938944cc in -[NSLayoutManager(NSPrivate)
_invalidateLayoutForExtendedCharacterRange:isSoft:invalidateUsage:]
#5 0x93490a48 in -[NSLayoutManager(NSPrivate)
_invalidateLayoutForExtendedCharacterRange:isSoft:]
#6 0x9349271f in -[NSLayoutManager textContainerChangedGeometry:]
#7 0x9348a92b in -[NSTextContainer setContainerSize:]
#8 0x0026d71a in -[MyTestController textDidChange_private:] at
MyTestController.m:2238
#9 0x0026cbdd in -[MyTestController _TextStorageContentChanged:] at
MyTestController.m:2017
#10 0x961632dc in _nsnote_callback
#11 0x90683aba in __CFXNotificationPost
#12 0x90683d93 in _CFXNotificationPostNotification
#13 0x96160440 in -[NSNotificationCenter
postNotificationName:object:userInfo:]
#14 0x96169c88 in -[NSNotificationCenter postNotificationName:object:]
#15 0x935450b5 in -[NSTextStorage processEditing]
#16 0x934749cf in -[NSTextStorage endEditing]
#17 0x93542e8d in -[NSTextView insertText:replacementRange:]
#18 0x935423d3 in -[NSTextView insertText:]
#19 0x93541efa in
-[NSKeyBindingManager(NSKeyBindingManager_MultiClients)
flushTextForClient:]
#20 0x9354044f in -[NSTSMInputContext interpretKeyEvents:]
#21 0x9353ff1a in -[NSView interpretKeyEvents:]
#22 0x9353fe2a in -[NSTextView keyDown:]
#23 0x003a8cca in -[MyTextView keyDown:] at MyTextView.m:896
#24 0x934b03a5 in -[NSWindow sendEvent:]
#25 0x002e9d98 in -[MyDocumentWindow sendEvent:] at
MyDocumentWindow.m:85
#26 0x9347c311 in -[NSApplication sendEvent:]
#27 0x0007d420 in -[MyApplication sendEvent:] at MyApplication.m:1174
#28 0x933d9d0f in -[NSApplication run]
#29 0x933a6f14 in NSApplicationMain
#30 0x0001705b in main at main.m:106
_______________________________________________
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