I opened one of my projects and Xcode
asked me for updating source to Swift 3
. After clicking save I got as expected an error. The error occurs while creating a fetchRequest
. (Error with error message in line 8)
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let appDelegate = UIApplication.shared().delegate as! AppDelegate
let managedContext = appDelegate.managedObjectContext!
let fetchRequest = NSFetchRequest(entityName:"Sessions") //<- Error error message: generic parameter 'ResultType' could not be inferred
do {
sessions = try managedContext.fetch(fetchRequest) as! [Sessions]
} catch let error as NSError {
print("Could not fetch \(error), \(error.userInfo)")
}
print("fetched")
self.tableView.reloadData()
}
}