Code: Select all
0 _KKMDBackingData.getValue(forKey:)
Code: Select all
1 protocol witness for BackingData.getValue(forKey:) in conformance _InitialBackingData
Code: Select all
2 PersistentModel.getValue(forKey:)
Code: Select all
3 CalorieEntry.id.getter
KalorieEntie ist eine benutzerdefinierte Klasse, wie unten gezeigt:
@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>
Ich kann nichts Bestimmtes identifizieren, das den App zum Absturz bringt. Hat jemand irgendwelche Ideen?