Memory limitation of NSScrollView
Memory limitation of NSScrollView
- Subject: Memory limitation of NSScrollView
- From: Christian Mike <email@hidden>
- Date: Thu, 26 Jul 2001 08:16:54 -0500
I am porting an application from Mac OS 9 (and Windows NT) to Mac OS X. This
application has a user command window for entering text commands and viewing
text output. In Max OS 9 and Windows NT, I must keep track of the size of
the buffer that contains the "contents" of the command window. As that
buffer fills up, I discard the oldest stuff at the top and keep only the
newest text that is getting appended to the end. The user can scroll the
window back quite a ways and view anything that was not discarded.
Now I want to do the same thing in Cocoa. I have a few questions.
1.) If I create an NSScrollView in IB and start throwing text into it, how
big is the default buffer before it fills up and won't accept any more?
2.) If it will grow automatically to an unlimited size, should I put some
artificial limit (say 2MB) on the size and start throwing out the oldest
stuff so that it doesn't hog memory?
3.) In Windows NT, I programmatically select the oldest text in the window
(usually scrolled off the top) and delete (cut) it. Will that same approach
work here, or should I do something different?
Thanks.
Michael Christian
Thomson multimedia Inc.