I'm building a small demo app with MQTTKit and Estimote iOS SDK that ranges the beacons and sends the beacons proximity uuid, major and minor to a MQTT broker.
The sample works fine for a while, but sometimes it crashes and I get a EXC_BAD_ACCESS (code=2, address=0x27c8eff4))
on Thread 1 - Queue:com.apple.main-thread
. In XCode, while debugging I can see the following when the exception throws:
CoreFoundation`CFRelease:
0x2fdc9f54: push {r4, r5, r6, r7, lr}
That is where the exception occurs, but I have no clue what that represents nor what it means.
Could anyone point out what is that I am not retaining or releasing to early, because from what I have read is something among the lines of objects being released to early and trying to access them after being released?
EDIT: As per the comment's suggestions, I have enabled NSZombies
and breakpoints on exceptions and now I get more info:
Pulsr(21312,0x3cb4118c) malloc: *** error for object 0x16f27404: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug
And the line where it stops is at [UIView animateWith ...];
:
dispatch_async(dispatch_get_main_queue(), ^(void){
[UIView animateWithDuration:0.250
delay:0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
weakSelf.streamingCountLabel.layer.backgroundColor = streaming ? weakSelf.yellowColor.CGColor : weakSelf.redColor.CGColor;
}
completion:nil];
if (!streaming)
{
weakSelf.streamingCountLabel.text = @"0";
}
});