Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit-speed file loading



TextEdit calls -[NSLayoutManager setAllowsNonContiguousLayout:YES]; could that be it?
Ali



On Feb 28, 2008, at 20:06 , Steven Degutis wrote:

I have a large (ascii) text file, about 65 MB, which TextEdit loads
instantaneously in about a split second. I've tried to mimic this
behavior using NSTextView to no avail. The problem isn't about
unresponsiveness, because it's completely responsive during this
loading of the large text file. The problem is that the NSTextView
continuously loads the file over a period of about 30 seconds, not
instantly like TextEdit does. Browsing through TextEdit's source, I've
noticed that it removes all layout managers before the file is loaded
into the NSTextStorage, and re-adds them all back afterwards (using
NSEnumerator). When I tried to implement this into my own application,
it showed no difference in speed. Could this really be a major factor?
What other ways could I speed up a load of a large text file (several
hundred MB) into an NSTextView? Or, perhaps, is there a better Cocoa
control to use for large text files?
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >TextEdit-speed file loading (From: "Steven Degutis" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.