.plist the Data Couldn't Be Read Because It Isn't in the Correct Format
SOLVED: The data couldn't exist read considering it isn't in the correct format.
Forums > SwiftUI
| @iam-that-one
this is the API and this is structs only I got this fault. (The data couldn't be read because information technology isn't in the right format.). I congenital the structs from a script ane |
| @roosterboy HWS+
Is that the bodily JSON yous are testing with or did y'all requite us an altered version? Because it's non valid JSON due to these lines: They should be: i |
| @iam-that-one
yea information technology is contradistinct, becuase the response contains my data. just I desire to know if the structs correspond the json structure or not, and how to practise information technology. The actual JSON is valid and contains an actual latitude and longitude. request function: i |
| @roosterboy HWS+
Aye. Once I corrected the zeroes consequence, your A tip... When decoding JSON, don't do this: Do this instead: It will give you much more than detail about what the problem is. This: versus this: ane |
| @iam-that-one
I got the trouble when I print(error), I changed latitude, longitude to exist String instade of Double, thankyou. 1 |
| @iam-that-i
I am lamentable. merely why some properties contains nil within. The API has a value. i |
| @roosterboy HWS+
Okay, subsequently hunting down some sample API data—which yous really should supply with these types of questions, as your And then when you lot create your OR, you tin add together explicit key mappings to your Note that doing information technology this mode would let you to keep 1 |
| @iam-that-ane
Give thanks you, it was my fault, I just took sampel of resopnses that is not workes in my case, or non represents the actual response from API. i |
Sponsor Hacking with Swift and reach the world's largest Swift customs!
Reply to this topic…
Y'all need to create an account or log in to reply.
All interactions here are governed past our code of conduct.
rutledgeappre1994.blogspot.com
Source: https://www.hackingwithswift.com/forums/swiftui/the-data-couldn-t-be-read-because-it-isn-t-in-the-correct-format/7440
Belum ada Komentar untuk ".plist the Data Couldn't Be Read Because It Isn't in the Correct Format"
Posting Komentar