I know that there are a tons of question with same question, but no one helped me.
I have Object DimensionItemHolder and property :
@property(nonatomic) float * sum;
in recursion function I have :
DimensionItemHolder * holder = [self getDimensionItemWhitIndex:[dimensionItem.dimItemID shortValue]];
if (holder)
{
NSLog(@"%f , %f , %f , %f , %f : %p", holder.sum[0],holder.sum[1],holder.sum[2],holder.sum[3],holder.sum[4] , holder.sum);
[self.itemOrderdArray removeObject:holder];
[self substractSum:holder.sum];
NSLog(@"%p", holder.sum);
return holder.sum;
}
And after few iteration xcode throw
Thread 1: EXC_BAD_ACCESS(code = 1, address 0xc080000c)
at line
NSLog(@"%p", holder.sum);
I figer it out that it has to do whit function
[self substractSum:holder.sum];
(if I comment it it works)
the function is :
-(void)substractSum:(float *)subSum{
if (subSum) {
self.sum[0] = self.sum[0] - subSum[0];
self.sum[1] = self.sum[1] - subSum[1];
self.sum[2] = self.sum[2] - subSum[2];
self.sum[3] = self.sum[3] - subSum[3];
self.sum[4] = self.sum[4] - subSum[4];
}
}