Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
84 views

I have the following CoreData stack: @MainActor final class CoreDataStack { static let shared = CoreDataStack() let privateContext: NSManagedObjectContext //used for database read/writes, ...
Andriy Gordiychuk's user avatar
0 votes
0 answers
55 views

I have the following CoreData stack in my app: let mom = NSManagedObjectModel(contentsOf:modelURL)! managedObjectContext = NSManagedObjectContext(concurrencyType:.mainQueueConcurrencyType) ...
Andriy Gordiychuk's user avatar
Best practices
0 votes
5 replies
84 views

I have a CoreData entity Topic which has a one-to-many relationship to Question (questions with inverse relationship being topic). Each Question contains the previousAttempt property. I am working on ...
Andriy Gordiychuk's user avatar
2 votes
1 answer
166 views

In my App.xcdatamodeld I have an entity called File. When I am building the project with Xcode, file FileEntity+CoreDataProperties.swift is generated. After upgrading Xcode to version 26.0 (17A324), I ...
user3626411's user avatar
0 votes
1 answer
78 views

I’m building a Swift app that uses CoreData (SQLite) for local data storage. When a user sets up a new iPhone via Quick Start (device-to-device transfer), the app’s Core Data database is transferred ...
m-ogawa's user avatar
  • 23
-4 votes
1 answer
77 views

I have a view model with a published array foodItems, containing the data for a List in the related parent View. The array is initially filled from CoreData by calling the loadFoodItems function. ...
Ulrich's user avatar
  • 229
1 vote
1 answer
211 views

I'm working with SwiftData and trying to replicate behavior similar to what I used to do with CoreData, where I had an extension on NSManagedObjectContext that allowed me to fetch all stored objects, ...
Richard Witherspoon's user avatar
0 votes
0 answers
112 views

I understand managed objects are not thread safe with Core Data, so if you need to access their properties on a different thread you need to get a new managed object via the objectID from the ...
Jordan H's user avatar
  • 56.5k
0 votes
0 answers
106 views

I am developing a Screen Time App for iOS and I am having issues with the ShieldConfigurationExtension (ShieldConfigurationDataSource). I know this extensions is sandboxed but I should be able to read ...
Lukáš Matuška's user avatar
0 votes
0 answers
40 views

I’m using Core Data in a macOS app and performing most work in a background context. However, I’d like to take advantage of Core Data’s built-in undo functionality and I’m struggling with how to ...
user10711707's user avatar
0 votes
0 answers
65 views

How to migrate if the following problem occurs? The current Coredata and CloudKit database contains records which do not use allowCloudEncryption. Since we thought of advanced data protection for user'...
FE_Tech's user avatar
  • 1,812
0 votes
0 answers
52 views

I have a grid setup where I'm displaying multiple images which is working fine. Images are ordered by the date they're added, newest to oldest. I'm trying to set it up so that the user can change the ...
Ceri Turner's user avatar
0 votes
0 answers
63 views

I'm using Core Data in my iOS application, and I want to encrypt some string properties using AES with a key that is generated and saved in the keychain. I'm using ValueTransformer to encrypt/decrypt ...
YosiFZ's user avatar
  • 7,920
0 votes
0 answers
89 views

I have a large list of book entities shown in a SwiftUI list (Around 10k to 50k books). I want to capture the ids of the list of books in the array in order when the user tap a list row. The issue is ...
User95797654974's user avatar
0 votes
1 answer
135 views

In Core Data, I use the following code to fetch all entities with a name: func fetchAllEntities(for entityName: String) -> [NSManagedObject]? { let fetchRequest = NSFetchRequest<...
koen's user avatar
  • 5,862
0 votes
0 answers
36 views

A user has accidentally deleted a root record that removes all data from the user. The data is stored in Cloudkit CoreData with Transaction History enabled. I have noticed in the CoreData database ...
user14341201's user avatar
0 votes
1 answer
57 views

I need to know the source of the changed coredata objects returned from NSManagedObjectContextObjectsDidChange. I have some shared objects, and want to send a notification if the source is other than ...
Elijah's user avatar
  • 8,650
0 votes
0 answers
16 views

In core-data I have a contact and location entity. I have one-to-many relationship from contact to locations and one-to-one from location to contact. I create contact in a seperate view and save it. ...
vrao's user avatar
  • 695
0 votes
0 answers
171 views

I am trying to save a screenshot to my app using an action extension directly from the screenshot thumbnail you see as soon as you take a screenshot but the method loadItem(forTypeIdentifier:options:...
Abdullah Ajmal's user avatar
-2 votes
1 answer
193 views

Swift 5 How to resolve warnings: 'Sending value of non-Sendable type '() throws -> ()' risks causing data races; this is an error in the Swift 6 language mode' for this code: import CoreData ...
john07's user avatar
  • 564
-1 votes
1 answer
73 views

I am new to CoreData but I made an object that I intend to use an array of within a ForEach loop in SwiftUI. In the entity editor I added a UUID attribute stored_id. Then in an extension I wrote this: ...
CalebK's user avatar
  • 737
0 votes
0 answers
80 views

I am getting crash 'Can not save Object with references outside of their own stores' while decoding NSManagedObject. Here is the detail. I have two NSManagedObjects. Parent: FitnessWrapper and Child: ...
Aaban Tariq Murtaza's user avatar
0 votes
0 answers
122 views

This is my definition of Model for SwiftData: import SwiftData @Model class TerritoryGroup { var name: String? var territories: [Territory]? init(name: String) { self.name = name ...
Bartłomiej Semańczyk's user avatar
0 votes
0 answers
48 views

Here is my @FetchRequest for User entity: struct SettingsView: View { @Environment(\.managedObjectContext) private var viewContext @FetchRequest( entity: User.entity(), ...
Bartłomiej Semańczyk's user avatar
0 votes
1 answer
50 views

I have setup push notifications and updates in CK are updating UI well. The issue I have is Syncing between Core Data and CK. It's set to use NSPersistentCloudKitContainer with ...
drewglew's user avatar
  • 148
5 votes
1 answer
739 views

I'm using SwiftData in my SwiftUI iOS app, and I need to implement a MigrationPlan before launching, so things go smoothly later when I need to make changes to the data being saved. For example, ...
pez's user avatar
  • 4,337
0 votes
1 answer
47 views

I would like to create a temporary BOOL property in a custom NSManagedObject class to track whether an async download of a remote image is underway so as not to start a second download while the first ...
user6631314's user avatar
  • 2,050
0 votes
1 answer
53 views

I have a project with 3 targets: main application an extension framework (with coredata management for sharing with main app and extension) I set App Groups for main app and extension. When I trying ...
niskah-media's user avatar
1 vote
0 answers
212 views

In my app, I've been using ModelActors in SwiftData, and using actors with a custom executor in Core Data to create concurrency safe services. I have multiple actor services that relate to different ...
Jordan Ellis's user avatar
0 votes
0 answers
58 views

The ios app works when hooked to a mac and run in debug mode, sometimes it fails. When I clean and rebuild it works for sometime and then fails again. Also if I start the app sometimes it works, ...
vrao's user avatar
  • 695
0 votes
0 answers
67 views

I am trying to loop through an array of ManagedObjects in Swift (that should have just one item) and am getting an error at runtime of Thread 57: Fatal error: NSArray element failed to match the ...
user6631314's user avatar
  • 2,050
0 votes
0 answers
62 views

I have an entity with an attribute called "plainText" which stores text of type "String". I want to fetch the objects based on a custom sort descriptor which is used in ...
FE_Tech's user avatar
  • 1,812
-2 votes
1 answer
128 views

What is the right approach to seed Core Data database at the first launch? I have sql db with precreated data. I need to make this data available to the user at the app's first launch and then delete ...
Danil's user avatar
  • 113
0 votes
0 answers
54 views

I’m getting a 0xdead10cc crash in a basic CoreData/CloudKit application. I only have one CoreData save call and it's made when the app is in the foreground and it's minor so I don't think it's being ...
Richard Witherspoon's user avatar
-1 votes
1 answer
71 views

I am trying to build a graph of words, where each word has a relationship to each word with the same letters plus one, like for example : table -> ablate, cablet, tabled, gablet, albeit, albite, ...
Simon W's user avatar
  • 101
0 votes
1 answer
258 views

I wasn't sure how to phrase the question. I know it's misleading. Context: I'm using NSPersistentCloudKitContainer for my public and private database. The CoreData model has two configurations: Local, ...
Jonathan's user avatar
  • 2,383
0 votes
0 answers
77 views

I have a Core Data project, with my SwiftUI view hooked on to different properties of the attributes in the model, and the change tracking works great. I want to add a simple boolean property to my ...
Z S's user avatar
  • 7,577
0 votes
0 answers
48 views

I am using CoreData with CloudKit in my iOS app, and I have encountered a series of issues while syncing data. The logs show multiple context saves and migration skips, but there’s no clear indication ...
Greg_R's user avatar
  • 1
0 votes
1 answer
31 views

Let's say I have a Person entity with various attributes of which one of its attributes has a uniqueness constraint so that there are no duplicate Person entities. It has an unordered to-many ...
user10711707's user avatar
0 votes
1 answer
65 views

I have one-to-many relationship in CoreData defined in the following way: private func configureOneToManyRelationship(sourceEntity: NSEntityDescription, ...
plamkata__'s user avatar
2 votes
0 answers
86 views

I have Library and Books entities where one library can contain many books where the relationship is an inherently ordered one in my app since the user can store the books in whatever order they want ...
User95797654974's user avatar
0 votes
1 answer
349 views

Consider this CoreData stack written for Swift 5.10 import CoreData final class CoreDataStack { static let shared = CoreDataStack() private init() { } lazy var ...
tospig's user avatar
  • 8,407
0 votes
0 answers
76 views

I have a SwiftUI view that I want to move the fetch request in a view model. For normal fetching I did it like this Consider this model class MyType { let title: String let category: String ...
s_diaconu's user avatar
  • 315
0 votes
0 answers
114 views

I tried looking everywhere online and asked AI, but it seems none of the solutions resolved my issue. I am using CoreData or SwiftData with CloudKit to fetch data from the database. I created a simple ...
Travgalax's user avatar
0 votes
0 answers
57 views

I have a UICollectionView populated with a diffable data source being populated with Core Data managed objects from an NSFetchedResultsController. It is based on this tutorial by Antoine Van Der Lee. ...
stackunderflow's user avatar
0 votes
1 answer
153 views

I'm inserting hundreds of thousands of objects using NSBatchInsert, now i want to add relationships between objects (let say A and B, with 1-to-many relationship) as no batch operation supports ...
Red Mak's user avatar
  • 696
0 votes
0 answers
28 views

I have a CoreData entity called Item, which may or may not contain Properties. I would like to fetch all Items that have not yet been assigned any Properties. extension Item { @nonobjc public ...
zkvvoob's user avatar
  • 496
1 vote
0 answers
122 views

I'm having an error at runtime related to the UUID in my code. Let me explain whats attached. Below are the Persistence Controller, DeflectionLogEntity, DeflectionLogViewModel, and the main issue, ...
Drew Hengehold's user avatar
0 votes
0 answers
65 views

I'm using Core Data in my iOS application and I have one property that is encrypted using ValueTransformer: class EncryptedStringTransformer: ValueTransformer { private var encryptionKey: String init(...
YosiFZ's user avatar
  • 7,920
1 vote
0 answers
40 views

My iOS app can change account. SQLite file is saved to [account]_dbfile.sqlite. If I logged in ABC named account, call CoreDataManager.shared.setup("ABC") and fetch, save blahblah... Then, ...
strawnut's user avatar
  • 405

1
2 3 4 5
643