Swift Tutorial - Building Lists and Navigation - Section 2 - Landmarks Quit Unexpectedly

Hi all.

I am trying to learn Swift, I am enjoying it so far but I've come to a stop. On the Building Lists and Navigation - Section 2, my code quits unexpectedly. I think I've narrowed it down to this:

struct LandmarkRow_Previews: PreviewProvider {
    static var previews: some View {
        LandmarkRow(landmark: landmarks[0])
    }
}

I have copied the pasted the code, and it will not work. Can someone help me fix this please? I am running Xcode 13.1.

Thanks.

When some part of the code is not working as expected, you may have some faults in other parts of your code. In this case, you may need to check all the parts where landmarks appears. One more, when your app quit unexpectedly, please show all the messages shown in the debug console.

UPDATE: Ignore my comment: In my model, I spelled Longitude incorrectly. Thus causing my error.

I would look through your error log and see if that can point to your error. Maybe you made the same mistake I did?

I am getting the same issue and believe its being caused in the same part of the code. Since everything was working fine up until this point. Ive double checked everything in the code and everything is correct. I believe the error might be related to the below debug but not sure as I got all the data from Apple.

debugDescription: "No value associated with key CodingKeys(stringValue: "longitute", intValue: nil) ("longitute").", underlyingError: nil))

Swift Tutorial - Building Lists and Navigation - Section 2 - Landmarks Quit Unexpectedly
 
 
Q