problem encoding large float* matrix
problem encoding large float* matrix
- Subject: problem encoding large float* matrix
- From: James Maxwell <email@hidden>
- Date: Tue, 1 Dec 2009 10:47:14 -0800
I'm trying to save the state of my app. It chews up a lot of memory, most of which is in large float* matrices. I'm getting an EXC_BAD_ACCESS error in -encodeBytes:length:forKey: and I'm just wondering what might be happening. The float* "coincidences" is a malloced array.
NSUInteger coincsSize = maxCoincs * inputSize * sizeof(float);
NSData* coincData = [NSData dataWithBytesNoCopy:&coincidences length:coincsSize];
[aCoder encodeBytes:[coincData bytes] length:coincsSize forKey:@"coincidences"];
The app runs fine, but when I try to save, boom... EXC_BAD_ACCESS.
Is this a decent way to save a float* array?
J._______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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