Looping calls to update waveform time range can cause crash
I have a couple of crashes reported where it looks like the SCScrollableWaveformView gets into a nasty loop when the KVO observing function changes the time range and then this somehow results in the observing function triggering again to update the scroll view which then triggers the observing function to trigger and update the waveform which changes the time range again.
Here is a chunk of the stack trace that started it (which then effectively repeats many many times before crashing):
0x1002bcc28 -SCScrollableWaveformView _updateWaveform 0x1002bcf7c -SCScrollableWaveformView observeValueForKeyPath:ofObject:change:context:
4113 Foundation 0x18499bf64 NSKeyValueNotifyObserver + 304 4114 Foundation 0x18499ba8c NSKeyValueDidChange + 404 4115 Foundation 0x184a461ac -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 732 4116 Foundation 0x18499afc0 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 64 4117 Foundation 0x184a43b38 _NSSetPointValueAndNotify + 284
0x1002bce34 -SCScrollableWaveformView _updateScrollView 0x1002bcf7c -SCScrollableWaveformView observeValueForKeyPath:ofObject:change:context:
4120 Foundation 0x18499bf64 NSKeyValueNotifyObserver + 304 4121 Foundation 0x18499ba8c NSKeyValueDidChange + 404 4122 Foundation 0x184986624 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 120
0x1002c01dc -SCWaveformView setTimeRange:
4124 CoreFoundation 0x1840a4a60 invoking_ + 144 4125 CoreFoundation 0x183f9c488 -[NSInvocation invoke] + 284 4126 Foundation 0x1849ad270 NSKVOForwardInvocation + 300 4127 CoreFoundation 0x1840a2a1c _forwarding_ + 408 4128 CoreFoundation 0x183fa0c5c _CF_forwarding_prep_0 + 92
0x1002bcc28 -SCScrollableWaveformView _updateWaveform 0x1002bcf7c -SCScrollableWaveformView observeValueForKeyPath:ofObject:change:context:
4131 Foundation 0x18499bf64 NSKeyValueNotifyObserver + 304 4132 Foundation 0x18499ba8c NSKeyValueDidChange + 404 4133 Foundation 0x184a461ac -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 732 4134 Foundation 0x18499afc0 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 64 4135 Foundation 0x184a43b38 _NSSetPointValueAndNotify + 284 4136 UIKit 0x1893b8c54 -[UIScrollView _smoothScrollWithUpdateTime:] + 2400 `
Is anyone else encountering this problem? I don't have direct steps to reproduce this problem but I have 3 reports in the last 2 days (two on iPhone 6 with iOS 9.3.4 and one on iPhone 6s with iOS 9.3.3).