NSTextView spanning scroll skips to space

I have weird behavior with my application and I don’t know where it comes from. I have implemented NSScanner for a text view that works very well. The scanner works with text storage to set attributes in text memory using text view delegation methods. However, every time I enter a space, the closing scroll view scrolls back to the top of the text view. Can someone give me a clue where this comes from?

0
objective-c cocoa nsattributedstring nstextview nsscanner
source share
2 answers

Probably not much trouble for those who were more experienced than me, I found out the possible reasons for this behavior (see above), so I will post it here if someone is looking for solutions to such "problems". It seems to turn off the "Fixed layout" option in the XCode 4.x attribute inspector for NSTextView in case the problem solves the problem. The documentation for NSLayoutManager provides additional hints (in the Overview section): "Unbiased layout is an optional layout manager behavior new in Mac OS X v10.5 ..."

Perhaps someone more experienced than me will provide more information about this and the reason for the behavior of the surrounding scroller when a non-overlapping option is checked (which is the default).

+2
source share

I am stuck with the same problem, and turning off the Disjoint Layout really solves the problem, but it gives rise to another problem, which is that the NSTextView becomes sluggish for 10,000 lines of text. A similar question answered differently, but I wonder if it works he. This decision also imposes some restrictions that may not apply to you.

0
source share

All Articles