Hello i have tableview and loading items when table numberOFRowsInSection 0 gives fatal error: unexpectedly found nil while unwrapping an Optional value
My code here
var itemsList = [String]()
internal func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
self.itemsmessage.text = "Listed your last \(itemsList.count) items"
return itemsList.count
}
Giving Error
fatal error: unexpectedly found nil while unwrapping an Optional value
When return nil gives this error in self.itemsmessage.text line. Thank you.
itemsList
really an optional? if so, when in the flow of the app are you creating it? – Eli BraginskiynumberOfRowsInSection
because the method could be called quite often even if the value does not change. – vadian