Every time I try to set the value of a UILabel.text in swift it spits out the error "Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value". I am trying to set it to a value in a Double array plus a string.
Here is the code
I have tried to manually set the values of the variables i have also tried to set the value of the normal variable but nothing has fixed it.
let normal = [10, 0, 0.105, 0.002, 0, 0, 0, 0.020, 0.00375, 0.00000192, 0.0025]
let cal = normal[0] * 1
let fat = normal[1] * 1
let sod = normal[2] * 1000
let car = normal[3] * 1000
let sug = normal[4] * 1
let pro = normal[5] * 1
let cac = normal[6] * 1000
let nia = normal[7] * 100
let vb6 = normal[8] * 1000
let b12 = normal[9] * 1000000
let pan = normal[10] * 1000
let caf = Double(80)
//print(caf)
cal84.text = "Calories: \(cal)"
fat84.text = "Fat: \(fat)"
sod84.text = "Sodium: \(sod)"
car84.text = "Total Carbohydrates: \(car)"
sug84.text = "Total Sugar: \(sug)"
pro84.text = "Protein: \(pro)"
calc84.text = "Calcium: \(cac)"
nia84.text = "Niacin: \(nia)"
vb684.text = "Vitamin B6: \(vb6)"
b1284.text = "Vitamin B12: \(b12)"
pan84.text = "Pantothenic Acid \(pan)"