【发布时间】:2018-11-07 17:36:43
【问题描述】:
我正在开发一个 ios 应用程序。该应用程序使用 api。这是代码部分
它的api问题
let isSuccess = result["success"] as! Bool
if isSuccess {
var arrayPutMarker = [Any]()//To add marker on all three points
let arrTemp = result["best_times"] as! NSDictionary
let arrLocation = result["kml_coordinates"] as! NSArray
self.KMLArray = arrLocation
有时结果["kml_coordinates"] 为空,我在运行时收到此错误
unexpectedly found nil while unwrapping an Optional value
谁能帮我解决这个问题
谢谢 崇德
【问题讨论】:
-
这个问题没有解决我的问题
-
请编辑您的问题以提供Minimal, Complete, and Verifiable example。例如,我们绝对需要知道
result来自哪里...... -
结果来自api
-
@Somdeb 你必须付出你的努力,你不能得到你正在寻找的确切代码!
-
是的,这个问题确实解决了你的问题。只需阅读接受的答案。