I'm trying to cast A double? to String.
I've tried
let price = eventDataFromPrevious.dtPrice as? String
eventPriceLabel.text = price! + "€"
but I get this error when I get to that VC:
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
My eventDataFromPrevious object looks like this in a dump:
▿ LuxEvent.EventData #0
- idEvent: "53"
- dtTitle: "Anniversaire de Moon"
- dtStartDate: "2020-4-15 20:0:0"
- dtEndDate: "2020-4-16 5:0:0"
▿ dtPrice: Optional(1000.0)
- some: 1000.0
- dtAddress: "56, Avenue Frantz Clement, Mondorf-les-Bains, Luxembourg"
- fiCategory: "8"
- dtCity: ""
- dtDescription: "Soirée déguisée, apportez tous vos chiens et chiennes, et pas besoin de capotes!"
- dtLong: "6.27737"
- dtLat: "49.503963"
- dtImage: "defaultImage.jpg"
Note that I have to have dtPrice as a Double? because the price can be nil if an event is free.
Thanks for the help in advance!