i have a save function:
func save(){
if let encoded = try? JSONEncoder().encode(routes) {
UserDefaults.standard.set(encoded, forKey: saveKey)
}
}
and an init function:
init() {
if let data = UserDefaults.standard.data(forKey: saveKey){
print(data.base64EncodedString)
if let decoded = try? JSONDecoder().decode([RouteObject].self, from: data) {
routes = decoded
return
}
}
routes = []
}
onload this initiation there is no data. but 3382 bytes how get I the content form data? i don't know where the error is? debug is not possible I did get the info
Hello @Claude31,
I forget to implement a decoder but I missing any error :( thank you for your help :)
greeting