Text System Locks Up - Can't Find Reason
Text System Locks Up - Can't Find Reason
- Subject: Text System Locks Up - Can't Find Reason
- From: Seth Willits <email@hidden>
- Date: Wed, 11 Jun 2014 15:53:37 -0700
I have two sample projects: one works fine, one does not. Both read a large (120 MB) file of text into an NSTextStorage, and then display that text storage in a text view.
In the "Slow" project, the text view is created in IB and its text storage object is replaced. Scrolling all the way to the bottom of the text view is possible, but then it basically locks up indefinitely(?) doing text layout. It's also possible to lock it up by resizing the text view soon after it opens.
In the "Fast" project, the text view, container, and layout manager are all created manually and hooked together. In this project it works great: no lockups ever
As far as I can tell, I've inspected every relevant property I can think of and the two setups are the same. I haven't a clue what's going on. The only hint I possibly had was from the docs: "Note that a text view can be resized based on its text container, and a text container can resize itself based on its text view. If you set both objects up to resize automatically in the same dimension, your application can get trapped in an infinite loop." Except that I checked this, and those conditions aren't met so it shouldn't be this.
I challenge(!!) any of you to figure this out. ;-)
Projects (and test file):
http://www.sethwillits.com/temp/TextDocumentTest.zip (700 KB)
Demo: (Note at 23 seconds in, the app has locked up — pinwheels aren't visible in screen recordings)
http://www.sethwillits.com/temp/SlowTextSystemDemo.mov
--
Seth Willits
_______________________________________________
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