Код: Выделить всё
Thread 18: Fatal error: Failed to validate placeVideosIn.placeVideosIn because placeVideosIn is not a member of VideoPlacementСбой происходит здесь:
Код: Выделить всё
static func findTransactions(after token: DefaultHistoryToken?) -> [DefaultHistoryTransaction] {
var historyDescriptor = HistoryDescriptor()
if let token {
historyDescriptor.predicate = #Predicate { transaction in
(transaction.token > token)
}
}
var transactions: [DefaultHistoryTransaction] = []
let taskContext = ModelContext(container)
do {
transactions = try taskContext.fetchHistory(historyDescriptor) //
Модель SwiftData имеет это свойство перечисления: < /p>
@Model
public final class Subscription {
// ...
public var placeVideosIn = VideoPlacement.defaultPlacement
}
< /code>
Enum выглядит так: < /p>
public enum VideoPlacement: Int {
case inbox = 0
case queueNext = 1
case nothing = 2
case defaultPlacement = 3
case queueLast = 4
}
Код: Выделить всё
public enum VideoPlacement: Int {
case inbox, queue, nothing, defaultPlacement
}
< /code>
Изменение всех значений вручную на, например, на, например, .defaultplacement Код: Выделить всё
var descriptor = HistoryDescriptor()
try modelContext.deleteHistory(descriptor)
Подробнее здесь: https://stackoverflow.com/questions/793 ... ory-for-hi
Мобильная версия