5
votes

I have an app that uses Core Data with iCloud to sync it's data across devices.

Now I want to display some of those data using a notification center widget of iOS. It is important that the notification center is up to date even without starting the app to do an iCloud update.

So I thought it would work just to use the same iCloud persistence stack for the extension.

I'm calling the creation of the stack in the - (id)initWithCoder:(NSCoder *)aDecoder method.

The issue that I'm experiencing is that the extension reconnects everytime one swipe down of the Notification Center to iCloud, which would be alright but after that it requires a second opening of Notification Center to see the current data which seems strange.

Has anybody some experience in using iCloud with this? And is there a best pratice to create an managedobjectcontext which shouldn't be reloaded overtime or is this just wrong for those kinds of extensions?

Edit: Some discussions on the dev forum are about the exact same problem but however there is no real solution for it. So I' starting this bounty.

1
Unfortunately, this is one of those cases where iCloud doesn't quite work yet. Sharing an iCloud store between an app and an extension will have these problems, and many others.quellish
So I wonder how does Apple actually solves this in it's Reminder app? This should uses CoreData and iCloud too...arnoapp
Reminders uses different XPC services.quellish
Too bad :( so this makes many Apps not suitable for the extensions :(arnoapp
Don't forget to file a bug bug report.apple.comquellish

1 Answers

1
votes

It's not possible to use iCloud Core Data stores with iOS8 Extensions, according to updates in this thread in devforums: https://devforums.apple.com/message/1051015#1051015