When i do "Build and analyze" xCode gives me the following warning:
Potential leak of an object allocated on line 70
Method returns an Objective-C object with a +1 retain count (owning reference)
Looping back to the head of the loop
Object allocated on line 70 is no longer referenced after this point and has a retain count of +1 (object leaked)
This is the code (line 70 is the one that begins with "NSString *newString"):
for(int j = 1; j < [smokeArray count]; j++) {
NSString *newString = [[NSString alloc] initWithFormat:@"Data: "];
int f = [[[smokeArray objectAtIndex:j] num] intValue];
for (int i = 0; i<6; i++) {
int d = [[[[smokeArray objectAtIndex:j] dat] objectAtIndex:i] intValue];
if (i>0) { newString = [newString stringByAppendingFormat:@"-%d",d]; }
else { newString = [newString stringByAppendingFormat:@"%d",d]; }
}
NSLog(@"%d, %@", f, newString);
}