Re: problem with NSMatrix
Re: problem with NSMatrix
- Subject: Re: problem with NSMatrix
- From: Andy Lee <email@hidden>
- Date: Sat, 6 Apr 2002 12:15:56 -0500
At 10:32 AM -0600 4/6/02, joie wrote:
furthermore, one other question: Would it be more appropriate to
implement my own row/column-adding method? renewRows:columns: is
quite nice, but it seems to give me problems- i had started doing it
my own way, and would have done it like that had i not noticed
renewRows:columns in NSMatrix's specification.
My gut feeling is to stick with -renewRows:columns: because it really
"should" work. That said, the issues that occur to me are:
(1) Do you do a lot of inserting, or is it mostly appending and
truncating rows and/or columns? The latter would suggest sticking
with -renewRows:columns:.
(2) Are there huge fluctuations in matrix dimensions? The docs say
-renewRows:columns: only adds or reuses cell instances -- it never
frees them. So if the matrix gets huge, but only rarely and
temporarily before reverting to tiny, *and* if the amount of memory
consumed is going to be significant, you might prefer to roll your
own resizing logic. (I didn't see an NSMatrix method to prune
unneeded cell instances. If there is one, never mind what I just
said.)
(3) Is your matrix large and sparse (i.e., with many cells in some
kind of "empty" or default state)? If so, using -renewRows:columns:
might create extra work because after growing the matrix you'll have
to explicitly set cells to the empty state, as opposed to getting
that empty state for free via the cloning of the cell prototype. It
would then be a question of how this compares to the extra work of
rolling your own resizing logic.
--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.