Closed FadyAckad closed 1 year ago
Hi @FadyAckad How about providing a default value just like this?
or do u have some good ideas? Thanks.
Hello, Thank you for the quick reply. Sadly, we're still using version 3. So having it fallback to 3.1.1
would be best for us at the moment, but is it possible to avoid using UserDefaults
here altogether and would having this flag as a property in the class work? From what I see the version is always set during the initialization of the client. So for example would the following snippet work?
private var mqttVersion: String = ""
func setMQTTVersion(_ version : String) {
mqttVersion = version
}
func queryMQTTVersion() -> String {
return mqttVersion
}
Hi. I write the default value for version which is 3.1.1 and also add static function to set version. Please using setMqtt3Version() or setMqtt5Version(). Thanks.
Hi, when this issue will be released?
Platform
OSX
Description
On macOS HighSierra, there's a bug in
UserDefaults
which causes it to lose its data and stop functioning until the machine is restarted or the processcfprefsd
is forcibly killed. This causes a crash inMQTTStorage
because of the following force unwrapping:There is also a way to reproduce it on newer OSX version:
$ defaults delete your.app.bundle.id
This also causes the app to crash immediately