NSData and Nested Arrays
NSData and Nested Arrays
- Subject: NSData and Nested Arrays
- From: "Fen Soares" <email@hidden>
- Date: Tue, 6 Mar 2007 09:18:10 +0000
I'm using RubyCocoa as a file parser. It returns an NSArray of NSArrays each
containing NSDecimalNumbers in the following format:
((1,2,3), (4,5,6), (7,8,9))
This obviously has quite a footprint and iteration is expensive. I have
previously converted it into a primitive c array, but really need it in
NSData format for archiving purposes and smaller memory footprint.
I've looked at the documentation, but am unclear as to how I should make the
conversion. I'd like to index and enumerate through the NSData object as
though each sequence of bytes were a struct:
struct vertex {
GLfloat x, y, z;
};
equivalent to this fictional accessor-type:
Vector *v = [NSData bytesAtIndex:index*sizeof(vertex)];
Any advice is much appreciated.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden