Re: my arrays are being deallocated, and i dky
Re: my arrays are being deallocated, and i dky
- Subject: Re: my arrays are being deallocated, and i dky
- From: Shawn Erickson <email@hidden>
- Date: Sat, 17 Jul 2004 15:26:15 -0700
On Jul 17, 2004, at 3:07 PM, myah payne wrote:
I have a class that is in obj-c++ and several structs predefined.
The main one is called MODEL. It consists of f pointers for each of
the other kind of structs. and an int to keep track of how long the
array of other sturcts is. Basically I say:
faces = new Face[numberOfFaces];
now this setup worked before when i was dealing with just one MODEL;
but now i want to put my MODELS into a NSNutableArray. So I am using
NSData to wrap the MODEL data and storing the NSData Object. When the
MODEL is needed later, the model's values are correct in that pointers
still have the same address. But the data that they were pointing is
long gone. I'm not sure why this is happening when before they
worked. IVe only changed the interface to the data, not the data code
itself.
Who calls the C++ style delete on the array of Faces that you create?
NSData cannot prevent your original delete operations from taking
place. Since you are using C++ you may just want to use a provided std
library collection for this.
As an asde maybe anyone knows a nice cocoa way to store some 8k floats
without too much over head.
Use a standard C array with enough space for the floats...? could even
carve that out the buffer in an NSData object. Not clear on what type
of over head you are talking about... storage, searching, access, etc.
-Shawn
_______________________________________________
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.