Skip to main content

Questions tagged [core-data]

Core Data is Apple's object modeling and persistence framework for iOS, iPadOS, tvOS, watchOS, and macOS. Xcode provides an object model editor for specifying entities, attributes, and relationships.

Filter by
Sorted by
Tagged with
3 votes
0 answers
105 views

I'm taking a class to try to learn iOS programming, and am working on a class project related to Core Data, filtering, and sorting. The class is doing a poor job teaching, but I'm close. I don't want ...
Dave Pawson's user avatar
0 votes
0 answers
63 views

I'm using NSPersistentCloudKitContainer and I have added an entity (to the private database) to the core data model. Now I have realised that I don't need that ...
Peter Warbo's user avatar
  • 11.9k
0 votes
1 answer
82 views

I'm testing SwiftData model inheritance (new in iOS 26) and encountering a crash when combining: A model that inherits from another model A separate model with relationships to the parent class ...
simnik's user avatar
  • 483
0 votes
0 answers
18 views

If I save data in my CoreData app, I get the following info in my Xcode console: cannot open file at line 42184 of [554764a6e7] os_unix.c:42184: (0) openDirectory(/Users/christiankrueger/Documents/...
Christian Krueger's user avatar
0 votes
0 answers
56 views

I have the following CoreData stack in my app: ...
Andriy Gordiychuk's user avatar
Best practices
0 votes
5 replies
95 views

I have a CoreData entity Topic which has a one-to-many relationship to Question (questions ...
Andriy Gordiychuk's user avatar
2 votes
1 answer
204 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
80 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
79 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 ...
Ulrich's user avatar
  • 231
1 vote
1 answer
254 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 ...
Richard Witherspoon's user avatar
0 votes
0 answers
158 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 ...
Jordan H's user avatar
  • 56.6k
0 votes
0 answers
130 views

I am developing a Screen Time App for iOS and I am having issues with the ShieldConfigurationExtension (...
Lukáš Matuška's user avatar
0 votes
0 answers
44 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
74 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,832
0 votes
0 answers
62 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
64 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
91 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
162 views

In Core Data, I use the following code to fetch all entities with a name: ...
koen's user avatar
  • 5,884
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
17 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
  • 715
0 votes
0 answers
180 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
211 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: ...
john07's user avatar
  • 564
-1 votes
1 answer
84 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....
CalebK's user avatar
  • 757
0 votes
0 answers
81 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
144 views

This is my definition of Model for SwiftData: ...
kunass2's user avatar
  • 62k
0 votes
0 answers
48 views

Here is my @FetchRequest for User entity: ...
kunass2's user avatar
  • 62k
0 votes
1 answer
56 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
868 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 ...
pez's user avatar
  • 4,417
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
58 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
227 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
60 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
  • 715
0 votes
0 answers
68 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
64 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,832
-2 votes
1 answer
151 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
  • 123
-1 votes
1 answer
72 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 : ...
Simon W's user avatar
  • 146
0 votes
1 answer
270 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
78 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
1 answer
32 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 ...
user10711707's user avatar
0 votes
1 answer
71 views

I have one-to-many relationship in CoreData defined in the following way: ...
plamkata__'s user avatar
2 votes
0 answers
88 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
402 views

Consider this CoreData stack written for Swift 5.10 ...
tospig's user avatar
  • 8,427
0 votes
0 answers
79 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 ...
s_diaconu's user avatar
  • 315
0 votes
1 answer
156 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
  • 704
0 votes
0 answers
51 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 ...
zkvvoob's user avatar
  • 506
1 vote
0 answers
126 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: ...
YosiFZ's user avatar
  • 7,920
1 vote
0 answers
44 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") ...
strawnut's user avatar
  • 425
1 vote
1 answer
88 views

Is it possible to apply a NSSortDescriptor that investigates two (or more!) keys while fetching from Core Data? Currently we fetch the objects and sort them in ...
AVS's user avatar
  • 494

1
2 3 4 5
643