Swift: handling an unexpected nil value, when variable is not optional [duplicate]
This question already has answers here : Check if property is set in Core Data? (2 answers) Closed 4 years ago . I have a UITableViewController loading its entries from Core Data via a NSFetchedResultsController . Like this: let historyItem = fetchedResults.objectAtIndexPath(indexPath) as HistoryItem historyItem has a title property defined like this: @NSManaged var title: String So in cellForRowAtIndexPath the code says cell?.textLabel?.text = historyItem.title and that should all be fine. title is not an optional and does not need unwrapping. However, in the past, the stored Core Data has