Reputation: 1
BOOL continueLoop;
CGPoint thePoint;
while(continueLoop != NO)
{
continueLoop = NO;
thePoint = [self generateRandomLocation];
NSMutableArray *blocks = [self getBlocksForX:thePoint.x];
for(BlueBlock *block in blocks)
{
if(block.getBlockLocationY == thePoint.y)
{
continueLoop = YES;
}
}
[blocks release];
}
This causes a crash when ran in instruments but not in Xcode. I narrowed the problem down, it happens when this line of code is in a loop... NSMutableArray *blocks = [self getBlocksForX: thePoint.x]; the method returns a NSMutableArray, I store it in blocks each time the loop is executed then at the end of the loop I release it. What would be causing instruments to crash?
Upvotes: 0
Views: 589
Reputation: 70743
since you never alloc
, copy
, or retain
blocks you should not be releasing it.
It may help for errors like this to run the static analyzer.
Upvotes: 3