Theocacao
Leopard
Design Element
Comment on "Intro to Memory and Arrays in C"
by Carl — Sep 28
Good start. I won't nitpick as others have done that already.

What I came looking for, is an introduction to Arrays and how to manage the differences between a regular C style array and an NSArray. You don't go into that except to barely mention NSArray. Since this is geared towards Cocoa, I think your introduction should at least cover creating, copying and destroyine NSArrays, and their contents. A separate more detailed tutorial on actually using features/methods of NSArrays would be left for another tutorial.

I needed to learn this stuff for a short app I'm working on using a grid, 15 by 9, and tying myself up with memory management, persistence of data, and sparce data in an array, but not possible (well, nothing is really impossible). I finally went with a 135 element NSString (each element is 2 chars long) which I index arithmetically (j*width+i)*2 using substring to extract my data.

I found NO good tutorials on how to do multi-dimensional arrays with NSArray. I did find a few, but none were really that helpful. I've got it figured out now, but your first tutorial on this was so good, I was disappointed it didn't cover more. So, my comments on adding something on NSArray for the beginners.
Back to "Intro to Memory and Arrays in C"
Design Element

Copyright © Scott Stevenson 2004-2015