Q: How to access and modify Core Data I have a Core Data entity with two attributes (title and time), both String. How can I access the time attribute by knowing the title and how can I modify the time property later?
I can access the title with a predicate but I don't know how to get and modify the title
func getTime(title: String, entityName: String) {
        let request: NSFetchRequest<NSFetchRequestResult> = NSFetchRequest(entityName: entityName)
        request.predicate = NSPredicate(format: "title == %@", title)
    }


A: Your function is not returning anything.
You still need to do a request, not only declaring it.
do {
    let fetchedTimes = try context.executeFetchRequest(request) as! [Time]
    return fetchedTimes
} catch {
    fatalError("Failed to fetch times: \(error)")
}

Change function:
func getTime(title: String, entityName: String) -> [time] {
