Post

Replies

Boosts

Views

Activity

Reply to App increases size even if I delete data (Core Data)
short answer: don't worry about it. Apple has invested heavily in CoreData and uses it extensively. wrt deleted records, Core Data will clean up its storage over time. longer answer: to understand what's going on, you'll have to dive into the architecture and implementation of structured database systems, and specifically how SQLite (which is used by default by Core Data) organizes data and indices into its file structures. For some insights, see here https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreData/PersistentStoreFeatures.html
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Intermittent crash when saving to Core Data
I recommend enabling all the debugging support for Core Data in Xcode. See here for more… https://useyourloaf.com/blog/debugging-core-data/ most often, a crash during save means you created an NSManagedObject in one context, and tried to save in another context. Also, you should be doing a save within the thread owned by the context, like this context.perform { // load objects // make changes try context.save() }
Dec ’21
Reply to SwiftUI - how to update a list of child object after an edit.
This sounds related to the current issue that support for DiffableDataSource in FetchedResultsController doesn't handle updates, only inserts, deletes, and moves. FetchedResultsController is the backbone of @FetchRequest in SwiftUI. See https://www.avanderlee.com/swift/diffable-data-sources-core-data/ for a good discussion of the issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to EXC_BAD_ACCESS Error in CoreData
turn on all these flags and see if the debugger points you to an issue in your code. https://useyourloaf.com/blog/debugging-core-data/
Replies
Boosts
Views
Activity
Aug ’21
Reply to App increases size even if I delete data (Core Data)
short answer: don't worry about it. Apple has invested heavily in CoreData and uses it extensively. wrt deleted records, Core Data will clean up its storage over time. longer answer: to understand what's going on, you'll have to dive into the architecture and implementation of structured database systems, and specifically how SQLite (which is used by default by Core Data) organizes data and indices into its file structures. For some insights, see here https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreData/PersistentStoreFeatures.html
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to NSPersistentCloudKitContainer with public database and pre-seeded data
check out https://github.com/jeffreykuiken/CloudKitSyncMonitor for hints at how to determine when first sync completes. You could also explore using multiple persistent stores, one with a read-only baseline of data, and another that syncs from CloudKit any additional data beyond baseline.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Data not load if FetchResults in init() methods
we're only getting a glimpse into your code, but my guess is that, when declared as vars, they are instantiated when the struct/object is created and don't have access to the environment variables such as "managedObjectContext". you might try using lazy?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Best options for database, cloud backup and sync
CoreData. The answer is always CoreData. And if you're planning for sync, just enable CoreData-CloudKit from the start, because migrations after-the-fact won't be easy.
Replies
Boosts
Views
Activity
Sep ’21
Reply to CoreData + CloudKit compilation problem in iOS 15
you need to import CloudKit for CKRecord. I hit a few of these as well, seems like Xcode 12 had some implicit imports. Just make the imports explicit, and you're good to go.
Replies
Boosts
Views
Activity
Sep ’21
Reply to NSInternalInconsistencyException : This NSPersistentStoreCoordinator has no persistent stores (disk full). It cannot perform a save operation
is the device storage full?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to UICloudSharingController no longer allows "add people"
Same. My production app works fine on iOS 14, missing "Add People" on iOS 15. Compiling with latest Xcode doesn't help. Also filed a report (FB9342748) during beta. Apple's first-party apps like Notes and Reminders doesn't seem to have this issue.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Achievements and leaderboards for a non-game app
I can only say that, years ago I tried to add GameKit to a non-gaming app and it was ultimately rejected (thankfully I hadn't burned too much time on that feature). You'd probably do better to integrate with HealthKit, allowing users to contribute to their activity rings.
Topic: Graphics & Games SubTopic: GameKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to MusicKit - Dynamic Queue
check this out https://developer.apple.com/documentation/mediaplayer/mpmusicplayerapplicationcontroller/2815055-perform
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to CoreData CloudKit Sync not working between iPad and iPhone
is "iCloud Drive" enabled?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Cloudkit - Service Unavailable (6/2022) Request failed with http status code 503
maybe your app has enough users hitting CloudKit at the same time that its tripping over the rate limit?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to SwiftUI view does not update when FetchRequest data changes from inside Action Extension
research NSPersistentHistoryTracking
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Intermittent crash when saving to Core Data
I recommend enabling all the debugging support for Core Data in Xcode. See here for more… https://useyourloaf.com/blog/debugging-core-data/ most often, a crash during save means you created an NSManagedObject in one context, and tried to save in another context. Also, you should be doing a save within the thread owned by the context, like this context.perform { // load objects // make changes try context.save() }
Replies
Boosts
Views
Activity
Dec ’21