Sebastian Keller
09/13/2019, 2:53 PMIncorrectDereferenceException
? I want to use the iOS CMAltimeter class, but it's callback gets called from a non-main-thread when altimeter?.stopRelativeAltitudeUpdates()
is called. I tried a surrounding try
and catch
, but no luck. I can not freeze the callback, because that would freeze update()
too. I really don't know what else to do right now.
altimeter = CMAltimeter()
altimeter?.startRelativeAltitudeUpdatesToQueue(NSOperationQueue.mainQueue) { data: CMAltitudeData?, error: NSError? ->
update(data.pressure.doubleValue)
}
Can the relaxed mode help? If so, how to enable it?
Slack Conversation