我正在尝试解析JSON响应并使用swift在tableView中显示它。
以下是代码:
Cast from '(key: String, value: AnyObject)' to unrelated type '[String : Any]' always fails
我收到错误:
1 0 1 0 1 1 0 0 1 0 1 1
x potential static point
<----- would extend to
-----> would extend to
left cost at x: 3 - 2 = 1
right cost at x: 3 - 1 = 2
有什么问题?
数据如下所示:https://api.tfl.gov.uk/journey/journeyresults/1000266/to/1000013
答案 0 :(得分:1)
fetchedData
是一本字典。当您枚举字典时,会得到(key: Key, value: Value)
的元组。看起来你希望fetchedData
是一个数组,或者你的意思是
for eachFetchedJourney in fetchedData.values
如果您要展示JSON的样子,我们可以帮助您。