I don't understand why it is coming.
Asked
Active
Viewed 90 times
-5
Jeff Wolski
- 6,332
- 6
- 37
- 69
Rahul Gupta
- 501
- 1
- 7
- 15
-
3What does the actual error message say? Force casting is asking for trouble. – luk2302 Dec 22 '16 at 14:42
2 Answers
0
Are you sure that object for key "quantity" is array of Doubles? You force unwrapping results so make sure that it is [Double]
Rafał Wójcik
- 591
- 3
- 13
0
Try this
guard let quantity: [Double] = salesByStateResponse.value(forKey: "quantity") as? [Double] else {
return
}
Arnaud Wurmel
- 480
- 3
- 15
