Код: Выделить всё
0 _KKMDBackingData.getValue(forKey:)Код: Выделить всё
1 protocol witness for BackingData.getValue(forKey:) in conformance _InitialBackingDataКод: Выделить всё
2 PersistentModel.getValue(forKey:)Код: Выделить всё
3 CalorieEntry.id.getterCalorieentry является пользовательским классом, как показано ниже:
@Model
final class CalorieEntry: @unchecked Sendable {
@Attribute(.unique) private(set) var id: UUID
var date: Date
var calories: Int
var narrative: String?
var isInHK: Bool
var healthKitUUID: UUID?
var realEntry: Bool
var meal: UUID
init(date: Date, calories: Int, narrative: String?, mealUUID: UUID, isInHK: Bool, healthKitUUID: UUID?) {
self.id = UUID()
self.date = date
self.calories = calories
self.narrative = narrative ?? nil
self.isInHK = isInHK
self.realEntry = true
self.meal = mealUUID
if (self.isInHK) == false {
self.healthKitUUID = nil
} else {
if healthKitUUID != nil {
self.healthKitUUID = healthKitUUID
} else {
self.healthKitUUID = nil
self.isInHK = false
}
}
}
func delete(context: ModelContext) {
do {
context.delete(self)
try context.save()
} catch {
print("Error deleting calories: \(error)")
}
}
}
< /code>
Я не могу идентифицировать что -либо конкретное, что может сделать приложение сбоем. У кого -нибудь есть идеи?
Подробнее здесь: https://stackoverflow.com/questions/795 ... background
Мобильная версия