Post

Replies

Boosts

Views

Activity

Core Data - Error: Persistent History (3) has to be truncated due to the following entities being removed
My app has 2 very simple models which gives me errors whenever I reload the data: CoreData: error: Error: Persistent History (3) has to be truncated due to the following entities being removed: ( RecipePersistentModel, Ingredient ) CoreData: warning: Warning: Dropping Indexes for Persistent History CoreData: warning: Warning: Dropping Transactions prior to 3 for Persistent History CoreData: warning: Warning: Dropping Changes prior to TransactionID 3 for Persistent History SQLite error code:1, 'no such table: ZINGREDIENT' CoreData: error: exception during newFetchedPKsForSourceID: I/O error for database at These are the models: final class RecipePersistentModel: Hashable { @Attribute(.unique) let id: String var title: String var desc: String @Relationship(deleteRule: .cascade) var ingredients: [Ingredient] = [] init(id: String, title: String, desc: String, ingredients: [Ingredient]) { self.id = id self.title = title self.desc = desc self.ingredients = ingredients } } final class Ingredient: Hashable { @Attribute(.unique) let id: String var name: String var count: Int init(id: String, name: String, count: Int) { self.id = id self.name = name self.count = count } } The app is on iOS 17 only. I'm having hard time working with SwiftData so far, whats wrong with this code?
3
1
703
Jan ’24
chartYScale crashes with MTLTExtureDescriptor issue
I'm trying to create a Line Mark with stock data from api. Just using the data will show the chart correctly but I need the Y axis range to not start from 0 but from the minimum value I give it. So I basically call something like this: .chartYScale(domain: viewmodel.range.0...viewmodel.range.1) And these are the range value we are working with: Range (19076.715, 19089.549) doing this basically crash the app with: -[MTLTextureDescriptorInternal validateWithDevice:]:1344: failed assertion `Texture Descriptor Validation MTLTextureDescriptor has height (16811) greater than the maximum allowed size of 8192. what am I doing wrong?
4
2
1.6k
Sep ’22
SwiftUI Chart scale issue
Hey guys I'm playing around with swiftUI charts using data from Yahoo Finance public api. I'm getting a data set of charts data and trying to display it using SwiftUI charts. My chart seems broken compared to what I'm seeing on the Yahoo webpage: My code looks like this (tried to keep it super simple for the example):     VStack {       Chart {         ForEach(viewmodel.chartData1) { chartData in           LineMark(x: .value("date", chartData.date),                y: .value("amount", "\(chartData.high)"))           .interpolationMethod(.catmullRom)                                 }       }     }     .task { await viewmodel.getSymbols() }   } So I'm not sure what I'm doing wrong and why does my chart looks downward trending like that. Any help, any lead would help!
1
0
1.7k
Jul ’22
Arm64 in excluded architectures - how to use?
I've created a framework which I want to build as an XCFramework. If I don't add arm64 to the excluded architectures i will get an error when building for simulator - something like "undefined symbols for..." If I add the arm64 to the excluded architectures it will build correctly for simulator but it will create an issue for building for a real device. So now what I do is - I build once for the simulator with the arm64 flag and I build again for real device without this flag. What is the correct way of doing this automatically?
1
1
8.1k
May ’21