0

So for a project I am doing for school, we need to decode some model objects using objective-c and others using swift.

I am trying to decode the json as an array of multiple sol detail objects. It is able to decode the name and total_photos keys, but when it gets to the photos: dictionary it crashes and is unable to decode. Any guidance towards a solution with this would be much appreciated.

Mars Rover API JSON

MarsRover Model Object

LSISoldetails model object

pawello2222
  • 34,912
  • 15
  • 99
  • 151

1 Answers1

0

Solution

I have figured out what I needed to do, so basically I needed to decode each dictionary individually, different from swift where you can use codable to decode a nested json array, in objective c apparently you have to decode them individually.

  • even worse. plenty amount of possibilities to decode json. https://stackoverflow.com/questions/5547311/how-do-i-parse-json-with-objective-c – Ol Sen Jul 29 '20 at 23:28