Post

Replies

Boosts

Views

Activity

Comment on Swift Core Data - Change Location of Persistent Store
Thank you for the input. I corrected the problem by adding code to to my core data manager class init which loads the persistent store. See code below. let persistentStoreURL: URL = URL(fileURLWithPath: "/Users/Chris/Downloads/Persistent Store/Index Funds.sqlite", isDirectory: false) let description = NSPersistentStoreDescription(url: persistentStoreURL) persistentContainer.persistentStoreDescriptions = [description]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23
Comment on Set Content View size/position upon retuning from navigation stack destination view
Originally the origin of the NSRect was calculated and the screen was part of that calculation so I passed it in. In the end I decided to hard code the values and just forgot to take it out. Good catch.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on NSTableView - How do I remove the horizontal gap between table cells
I will look at sizing of the tableview. I do not currently attempt to size the scroll view. Your streamlining of the code will be incorporated.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Updating displayed data generates reentrant warning
I noticed that occasionally when I selected the button, the table would flash. To eliminate the problem I removed vm.isLoading = true from the button action and added it to the MainActor call in the view model. This stopped the occasional flashing.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on SQLite - Select statement to extract 1 year of data
With strftime I can get the starting date, ie subtract 1 year from the latest date with substitutions, but I have to have the latest date to do so. Is there a way to include capturing the latest date as part of the query?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’23
Comment on CoreData Failure During Entity Creation in the ViewContext
Thank you. When adding entities to the managed object context using persistentContainer.performBackgroundTask, do I have to save twice? Save once in the background context which saves it to the parent context and then save in the parent context to push the added entities to persistent stores.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Comment on How do I animate a Swift line mark chart
Unable to initial showData with false. Used @State var showData: [Bool] = [] and in init: self.showData = Array(repeating: false, count: closingValues.count). showData is still empty. closingValues.count = 251
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’23
Comment on Swift Core Data - Change Location of Persistent Store
Thank you for the input. I corrected the problem by adding code to to my core data manager class init which loads the persistent store. See code below. let persistentStoreURL: URL = URL(fileURLWithPath: "/Users/Chris/Downloads/Persistent Store/Index Funds.sqlite", isDirectory: false) let description = NSPersistentStoreDescription(url: persistentStoreURL) persistentContainer.persistentStoreDescriptions = [description]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23