Post

Replies

Boosts

Views

Activity

Reply to Referencing instance method 'setValue(for:to:)' on 'Array' requires that 'Task' conform to 'PersistentModel'
I have same issue and I follow this path the compiler did't rise red alert but change to grey, but does anyone have such err Cannot convert value of type 'PredicateExpressions.Conjunction<PredicateExpressions.Equal<PredicateExpressions.KeyPath<PredicateExpressions.KeyPath<PredicateExpressions.Variable, User>, UUID>, PredicateExpressions.KeyPath<PredicateExpressions.Value, UUID>>, PredicateExpressions.Equal<PredicateExpressions.KeyPath<PredicateExpressions.Variable, Date>, PredicateExpressions.Value>>' to closure result type 'any StandardPredicateExpression' This issue come from the code func showTransByDate(user: User, date: Date) -> [Transaction] { let predictor = #Predicate<Transaction>{$0.tranInitiator.id == user.id && $0.tranDate == date} fetchDescriptorTrans = FetchDescriptor(predicate: predictor) let transList = try? contextTransaction?.fetch(fetchDescriptorTrans) if(transList!.isEmpty){return []} else{ return transList! }
Mar ’24