Hey there, everyone. It's been a while since I been to this place, and I am here because I really need help with an issue that is giving me grief.
I am working on an update for a multi-platform app I made to keep track of finances that will allow it to import data from QIF, in addition to a custom JSON file, and while the iOS side does not seem to be presenting any problems, I am having troubles with the mac side of the equation, in which the program hangs when presented with a large data set.
From my observations and setting breakpoints setup in my project, the program is retrieving the data as expected and the data is stored in the SQLite database, as it should, regardless of the size of data, with no problems whatsoever when pushing example data that has been modified to remove the comments and formatting the date to MM/DD/YYYY format or even smaller sets.
However, when I try to test importing a QIF file generated by GnuCash to QIF formatted for Quicken 2003, the program hangs when it is time for the view to be refreshed or initially loaded, even though it managed to retrieve around 756 objects and successfully saved them to the database.
When I initially noticed the hangs, I tried implementing async functions, to try and move the time consuming processes to another thread, as well as to allow a way to give the user a signal that the program is attempting to load data, but the program still ends up hanging on that particular import.
How do I go about fixing this?
Here are the functions doing the work that is supposed to be refreshing the view:
For context, my project's code containing the functionality in question can be found at the link below:
The mac code is in the macOS folder, the iOS folder contains the iOS code, and Shared contains shared elements.
If you need to see how I am parsing QIF files, the code for the custom library I wrote can be found at the link below:
I am working on an update for a multi-platform app I made to keep track of finances that will allow it to import data from QIF, in addition to a custom JSON file, and while the iOS side does not seem to be presenting any problems, I am having troubles with the mac side of the equation, in which the program hangs when presented with a large data set.
From my observations and setting breakpoints setup in my project, the program is retrieving the data as expected and the data is stored in the SQLite database, as it should, regardless of the size of data, with no problems whatsoever when pushing example data that has been modified to remove the comments and formatting the date to MM/DD/YYYY format or even smaller sets.
However, when I try to test importing a QIF file generated by GnuCash to QIF formatted for Quicken 2003, the program hangs when it is time for the view to be refreshed or initially loaded, even though it managed to retrieve around 756 objects and successfully saved them to the database.
When I initially noticed the hangs, I tried implementing async functions, to try and move the time consuming processes to another thread, as well as to allow a way to give the user a signal that the program is attempting to load data, but the program still ends up hanging on that particular import.
How do I go about fixing this?
Here are the functions doing the work that is supposed to be refreshing the view:
Code:
func retrieveRecords() async -> [Record] {
guard let databaseManager = DB.shared.manager, let storedRecords = try? databaseManager.records(inRange: .all) else { return [] }
return storedRecords
}
func loadRecords() {
Task {
let storedRecords = await retrieveRecords()
records.items = storedRecords
}
}
For context, my project's code containing the functionality in question can be found at the link below:
GitHub - bryceac/BCheckbook at qifSupport
Simple Checkbook Ledger for iOS and macOS. Contribute to bryceac/BCheckbook development by creating an account on GitHub.
github.com
The mac code is in the macOS folder, the iOS folder contains the iOS code, and Shared contains shared elements.
If you need to see how I am parsing QIF files, the code for the custom library I wrote can be found at the link below:
GitHub - bryceac/QIF: library to read and write QIF files using Swift.
library to read and write QIF files using Swift. Contribute to bryceac/QIF development by creating an account on GitHub.
github.com