|
I am getting an error of "unable to load saved data" (Xcode 12.3 - Simulator iPhone Xs 14.3) - log shows the following
ContentView code is.
Any clues. Regards |
|
Hi Quin, I wish I could help, I too am stuck on the same project with a problem that won't allow me to save my pins to IOS storage. Anyway, one thing I picked up on reading your code (although I'm sure it won't be much help) is that Paul had his 'locations' property with the initialiser brackets outside the array: so [CodableMKPointAnnotation]() |
|
Hi Quin, I too had the same problem. In my case it didn't work because decoding of title and subtitle in the CodablePointAnnotation class caused an error (which you don't see cause it's caught in the ContentView) I changed the "title = try container.decode(String.self, forKey: title)" in "title = try? container.decode(String.self, forKey: title) and did the same for subtitle. That worked for me. But I'm not sure if this is the proper solution. Still learning... |
|
Hello Roger. Thank you for that. I don't realy understand why that should work work but it seems to do the trick. All I noticed in your text was a missing "." before "title"
Like you still learning :-) |
BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.