core-data

NSPersistentStoreRemoteChangeNotification not getting fired

会有一股神秘感。 提交于 2020-06-25 20:19:39
问题 I am trying to perform history tracking in my CoreData+CloudKit project which uses NSPersistentCloudKitContainer . I have been following along with Apple's sample project I want to perform certain task when the remote store has been updated. For this apple recommends enabling remote notification in the Signing & capabilities's Background Mode section of the app. I have enabled History Tracking for my project as shown in Apple's sample project. // turn on persistent history tracking let

NSPersistentStoreRemoteChangeNotification not getting fired

我只是一个虾纸丫 提交于 2020-06-25 20:18:29
问题 I am trying to perform history tracking in my CoreData+CloudKit project which uses NSPersistentCloudKitContainer . I have been following along with Apple's sample project I want to perform certain task when the remote store has been updated. For this apple recommends enabling remote notification in the Signing & capabilities's Background Mode section of the app. I have enabled History Tracking for my project as shown in Apple's sample project. // turn on persistent history tracking let

iOS - Notify today extension for Core Data changes in the main app

限于喜欢 提交于 2020-06-25 16:56:58
问题 I have a NSManagedObject called Event that is shared between the host app and today extension. (In Target Membership, both the main app and the widget are checked). The host app and widget have the same App Group identifier and both share Data Model (In Target Membership, both the main app and the widget are checked). When I launch(run) the widget in Xcode, it shows all of the app events ( Event ) that are already saved in the host app. However, when I add a new event, it appears in the host

Relationship persistence with NSPersistentCloudKitContainer

こ雲淡風輕ζ 提交于 2020-06-24 10:08:50
问题 I'm working on an app that uses NSPersistentCloudKitContainer to share data between devices. The core data model has multiple entities, two of which are connected using a relationship with it's respective inverse. The issue I'm having is that when I set the relationship to nil the cloud data is not updated and when I restart the app, the relationship gets reset back what it was before it was set to nil . Is this a bug in the new NSPersistentCloudKitContainer ? Is anyone else having this issue

Relationship persistence with NSPersistentCloudKitContainer

点点圈 提交于 2020-06-24 10:07:07
问题 I'm working on an app that uses NSPersistentCloudKitContainer to share data between devices. The core data model has multiple entities, two of which are connected using a relationship with it's respective inverse. The issue I'm having is that when I set the relationship to nil the cloud data is not updated and when I restart the app, the relationship gets reset back what it was before it was set to nil . Is this a bug in the new NSPersistentCloudKitContainer ? Is anyone else having this issue

iOS: How to watch NSManagedObject attributes while debugging

大城市里の小女人 提交于 2020-06-24 08:39:08
问题 As the title said, I want to debug some Core Data bugs. Instead of using NSLog everywhere in the code, is it possible to watch a entity's attributes in XCode 4's watch window? Like the "quick watch" tool in Entity Framework 4.0 of .NET. 回答1: Any value that has a named variable assigned to it can be viewed in the debugger. In Xcode 4 it appears in the debugger's left column. If you select the variable, you can use the contextual menu option "Print to console" to have a detailed description

How to communicate between iOS App Containing Extension and Extension (not Host App)

空扰寡人 提交于 2020-06-24 01:54:47
问题 TLDR: Is it possible to send realtime messages or notifications between iOS App and it's Extension? I'm writing an iOS App with an extension that are part of the same App Group and share the same CoreData (SQLite database). I can read and write to the database using CoreData from the App and from the extension, they both share the same content. My Question is: Is it possible to send messages or notifications between the App and the extension to notify the other to update if necessary? I tried

how to group by day with core data?

£可爱£侵袭症+ 提交于 2020-06-22 12:17:47
问题 I have a Entity called deal and deal has a property called date which is the time this deal object inserted into the store. and one day may have several deal s. So I want count some data group by day, I want fetch day and countofsomething like: 2013-06-03 3 2013-06-02 4 and I don't want to use sectionPath because it only put deals into section. I know I can have this done by have another property(type:string) like dayOfTheDate which is like 2013-06-03 in each object. btw, transient property

Relationship's entity's data is <fault>

时光总嘲笑我的痴心妄想 提交于 2020-06-17 09:45:52
问题 I have asked reference question in this link.I got answer using NSMangedObjectID.Now I have used below function to get Component entity from its componentID.As in the API response of SyncSurveyWebReadings,I only get componentId,I need to fetch Component entity & set as relationship.Now time taking issue is not there.But may be relationship is not getting set.When I print the relationship object I got, Optional<Array<SurveyReadingWeb>> ▿ some : 1 element - 0 : <GazSurvey_Dev.SurveyReadingWeb:

Relationship's entity's data is <fault>

假装没事ソ 提交于 2020-06-17 09:44:39
问题 I have asked reference question in this link.I got answer using NSMangedObjectID.Now I have used below function to get Component entity from its componentID.As in the API response of SyncSurveyWebReadings,I only get componentId,I need to fetch Component entity & set as relationship.Now time taking issue is not there.But may be relationship is not getting set.When I print the relationship object I got, Optional<Array<SurveyReadingWeb>> ▿ some : 1 element - 0 : <GazSurvey_Dev.SurveyReadingWeb: