Post

Replies

Boosts

Views

Activity

Reply to Not receiving Persistent Store Remote Change Notification.
I think in built constants have to be used for keys so i changed the code to following... - (NSPersistentCloudKitContainer *)persistentContainer { // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. @synchronized (self) { if (_persistentContainer == nil) { _persistentContainer = [[NSPersistentCloudKitContainer alloc] initWithName:@"Expenses"]; [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) { if (error != nil) { #ifdef DEBUG NSLog(@"Unresolved error %@, %@", error, error.userInfo); #endif abort(); } else { #ifdef DEBUG NSLog(@"Store successfully initialized"); #endif [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:NSPersistentHistoryTrackingKey]; [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:NSPersistentStoreRemoteChangeNotificationPostOptionKey]; } }]; } return _persistentContainer; } } No errors or warnings. just no notifications!
Topic: App & System Services SubTopic: iCloud Tags:
Aug ’22
Reply to Not receiving Persistent Store Remote Change Notification.
By mistake i set the store descriptions inside if (error ! = nil) I changed that... yet no go... - (NSPersistentCloudKitContainer *)persistentContainer {     // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it.     @synchronized (self) {         if (_persistentContainer == nil) {             _persistentContainer = [[NSPersistentCloudKitContainer alloc] initWithName:@"Expenses"];                         [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {                 if (error != nil) {                    #ifdef DEBUG                     NSLog(@"Unresolved error %@, %@", error, error.userInfo); #endif                     abort();                 }                 else #ifdef DEBUG                     NSLog(@"Store successfully initialized"); #endif                 [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:@"PersistentHistoryTracking"];                 [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:@"NSPersistentStoreRemoteChangeNotificationOptionKey"];             }];         }     }         return _persistentContainer; }
Topic: App & System Services SubTopic: iCloud Tags:
Aug ’22
Reply to Could not merge changes: with oldVersion = 0 and newVersion = 4
I don't clearly understand when I should want in-memory changes and when store changes. I'm not editing from two ends. Just from the simulator. And, I want the last change to reflect all across. So, even if an entry was being edited from two ends simultaneously, the last one to be saved should be stored in the store. From the Using Core Data With CloudKit video it seems i'll have to take time stamps using a date object (from which I was removing hours minutes and seconds for sake of simplicity).
Topic: App & System Services SubTopic: iCloud Tags:
Aug ’22
Reply to Old local persistent store to new CloudKit store- lightweight migration
I realised I hadn't selected a container for the iCloud store. Since default container is not shown I selected one of the two containers I had. Now the app prints a huge log and there are no errors. Yet, retuned array is empty. Should I also select 'used with cloudkit' for the old store? If i do It gives me error saying many attributes should be optional. I am assuming this will mean changing the old store from what it is in the live app. I'll test it and get back.
Topic: App & System Services SubTopic: iCloud Tags:
Jan ’22
Reply to Not receiving Persistent Store Remote Change Notification.
I think in built constants have to be used for keys so i changed the code to following... - (NSPersistentCloudKitContainer *)persistentContainer { // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. @synchronized (self) { if (_persistentContainer == nil) { _persistentContainer = [[NSPersistentCloudKitContainer alloc] initWithName:@"Expenses"]; [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) { if (error != nil) { #ifdef DEBUG NSLog(@"Unresolved error %@, %@", error, error.userInfo); #endif abort(); } else { #ifdef DEBUG NSLog(@"Store successfully initialized"); #endif [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:NSPersistentHistoryTrackingKey]; [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:NSPersistentStoreRemoteChangeNotificationPostOptionKey]; } }]; } return _persistentContainer; } } No errors or warnings. just no notifications!
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Not receiving Persistent Store Remote Change Notification.
By mistake i set the store descriptions inside if (error ! = nil) I changed that... yet no go... - (NSPersistentCloudKitContainer *)persistentContainer {     // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it.     @synchronized (self) {         if (_persistentContainer == nil) {             _persistentContainer = [[NSPersistentCloudKitContainer alloc] initWithName:@"Expenses"];                         [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {                 if (error != nil) {                    #ifdef DEBUG                     NSLog(@"Unresolved error %@, %@", error, error.userInfo); #endif                     abort();                 }                 else #ifdef DEBUG                     NSLog(@"Store successfully initialized"); #endif                 [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:@"PersistentHistoryTracking"];                 [storeDescription setOption:[NSNumber numberWithBool:YES] forKey:@"NSPersistentStoreRemoteChangeNotificationOptionKey"];             }];         }     }         return _persistentContainer; }
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Could not merge changes: with oldVersion = 0 and newVersion = 4
I don't clearly understand when I should want in-memory changes and when store changes. I'm not editing from two ends. Just from the simulator. And, I want the last change to reflect all across. So, even if an entry was being edited from two ends simultaneously, the last one to be saved should be stored in the store. From the Using Core Data With CloudKit video it seems i'll have to take time stamps using a date object (from which I was removing hours minutes and seconds for sake of simplicity).
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Old local persistent store to new CloudKit store- lightweight migration
I realised I hadn't selected a container for the iCloud store. Since default container is not shown I selected one of the two containers I had. Now the app prints a huge log and there are no errors. Yet, retuned array is empty. Should I also select 'used with cloudkit' for the old store? If i do It gives me error saying many attributes should be optional. I am assuming this will mean changing the old store from what it is in the live app. I'll test it and get back.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Jan ’22