Skip to main content

All Questions

Tagged with
0 votes
1 answer
45 views

Iterating Over an Swift OrderedDictionary Initialized from a JSON

This is a followup question to this StackOverflow post I made, but now I'm trying to iterate over the menu field in the JSON to display all the menu options and allergens in SwiftUI. I have this ...
user28773992's user avatar
1 vote
2 answers
58 views

Parsing JSON in Swift Error: Expected to decode Array<Any> but found a dictionary instead

I'm trying to decode this JSON called Menu.json [ { "day": "Monday", "locationName": "Memorial Union Quad", "coordinate": [38.54141, -...
user28773992's user avatar
0 votes
1 answer
38 views

Chrome on IPad does not handle Async response.json() functions properly

When making a program that gets data from the server in json format, the program works in MS Windows (and on my Mac) but not on Chrome and Safari on IPad (Putting one tab chrome on Ipad to the URL: ...
oleviolin's user avatar
  • 1,033
0 votes
1 answer
68 views

Building an iOS App - Not allowed to save JSON file using Swift while testing on real device, but on simulator it works

I am trying to make an iOS app, and I have to save a JSON file but I get this error: Landmarks/ModelData.swift:45: Fatal error: Couldn't write to /private/var/containers/Bundle/Application/.../...
Victor's user avatar
  • 1
0 votes
1 answer
77 views

Swift decoding JSON object with multiple objects in it [closed]

I got a little lost while trying to decode a JSON object with multiple objects within it in from an API call. Hopefully I can get some guidance/examples of how to solve it. This is the JSON object: { ...
ia244's user avatar
  • 347
0 votes
1 answer
54 views

Decode json files and add it in array

I want to decode several json files and add it to array. I use this code to do it: struct SearchDetailSections: Decodable { var detailSections: [SearchDetailSection] } struct SearchDetailSection: ...
user's user avatar
  • 45
0 votes
0 answers
139 views

Swift JSON Decoding Error After Server Migration: Expected String but Found Number

I've recently migrated my Laravel API to a new server, and since then, I've encountered a recurring JSON decoding issue on the iOS (Swift) side of my application. The error message I'm getting is: ...
Mikber's user avatar
  • 43
0 votes
0 answers
59 views

How to save json file in unity for ios?

In Unity, i want to save some data of a trainer in a sports game in a json file. For this, i have the following function: public List<TrainerObjectData> ListOfObjects = new List<...
Berlin-Koeln's user avatar
0 votes
2 answers
189 views

How to properly retrieve json data from URL in swift

I'm working on a project using mealDB, and this is my first time working with a json DB and none of the data is populating in my app. I have a function: func fetchDesserts() async throws -> [Meal] {...
JonGrimes20's user avatar
-2 votes
1 answer
140 views

Escaped Double Quote in Swift breaking JSONDecoder decode

If you open a play ground and paste this code, you'll notice that the decoded object is nil. The JSON object [{"transcript":"A person might say, \"Hello\"."}] passes any ...
Saamer's user avatar
  • 5,104
0 votes
0 answers
50 views

How to display one object of api response in the cell at a time using tableview cells in

I have gotten some success to get to the end of the first nested array but now I have difficulties in shifting to next index Eg:- I am at { "choice" : 1742, "assessment" : 133, &...
Kshitij876's user avatar
-2 votes
1 answer
70 views

How to ignore part of the JSON?

In the following JSON I want to ignore the first part. JSON Example: { "game": { "friends": 10, "worlds": 50, }, "results": [ { "id&...
Ariel Antonio Fundora's user avatar
-1 votes
1 answer
76 views

Error mapping Optional JSON to RealmSwift @Persisted

Issue: There are two different objects within the array I am attempting to map and store into a RealmSwift database. However this parameter (@Persisted var folderItems: List) which is optional and ...
Shin0mar's user avatar
0 votes
1 answer
81 views

I'm encountering an error with my POST API request: 'Error parsing JSON'

I'm new to SwiftUI and having trouble posting an API request, I have checked everything but still getting 500 server error message. I'm stuck on this please help if possible Response data: <!...
Manish kumar's user avatar
1 vote
1 answer
66 views

How do you make data in an array nested within JSON data identifiable so you can list the data?

My goal is to display some data from a JSON file in a List in SwiftUI. This is for iOS 17. I have tried a lot of different things and have done some research, but cannot find the solution. Here's an ...
jwhite318's user avatar

15 30 50 per page
1
2 3 4 5
604