alekseyn / iCloudStoreManager

Demonstrates the use of UbiquityStoreManager, for using CoreData with iCloud
BSD 3-Clause "New" or "Revised" License
150 stars 59 forks source link

How to use same container in different App #10

Closed omarojo closed 11 years ago

omarojo commented 12 years ago

I have an iPad and iPhone application. I want to use same container so they can share coredata. I did put com.mycompany.myiPhoneapp in both iPad and iPhone entitlements. But they are not sharing core data.

Any suggestions?

omarojo commented 12 years ago

Hi Aleksey,

I implemented your iCloudStoreManager class but I have 2 different projects for iPad and for iPhone that have the same code data model.

Your class works well between same projects but I need the iPad version to share containers with the iPhone version.

I put same container names on both, and they are actually sharing the same "folder" on my iCloud manager. But there data is not been reflected on the apps, only in apps from same project.

As far as I know, projects needs to have 1 container named the same as the bundle, and in case of sharing with others apps like a MacOSX app. you need to add a new container

in my Ipad App

so when I created the ubiquityStoreManager in both Apps: ubiquityStoreManager = [[UbiquityStoreManager alloc] initWithManagedObjectModel: [self managedObjectModel]

localStoreURL: [self storeURL]

containerIdentifier: @"FC93132SZ9.com.mycompany.myiPhoneApp.shared"

additionalStoreOptions: nil];

Do u have any recommendations ?? shared folder is actually been shared, but not reflected on the apps. Only reflected on apps of the same kind (iPhone with iPhone) (iPad with iPad) this are 2 different apps with same core data stack structure.

Thanks in advance.Hi Aleksey,

I implemented your iCloudStoreManager class but I have 2 different projects for iPad and for iPhone that have the same code data model.

Your class works well between same projects but I need the iPad version to share containers with the iPhone version.

I put same container names on both, and they are actually sharing the same "folder" on my iCloud manager. But there data is not been reflected on the apps, only in apps from same project.

As far as I know, projects needs to have 1 container named the same as the bundle, and in case of sharing with others apps like a MacOSX app. you need to add a new container

in my Ipad App

so when I created the ubiquityStoreManager in both Apps: ubiquityStoreManager = [[UbiquityStoreManager alloc] initWithManagedObjectModel: [self managedObjectModel]

localStoreURL: [self storeURL]

containerIdentifier: @"FC93132SZ9.com.mycompany.myiPhoneApp.shared"

additionalStoreOptions: nil];

Do u have any recommendations ?? shared folder is actually been shared, but not reflected on the apps. Only reflected on apps of the same kind (iPhone with iPhone) (iPad with iPad) this are 2 different apps with same core data stack structure.

Thanks in advance.

alekseyn commented 11 years ago

I can't offer any recommendations at this time. With the release of iOS 6, iCloud has been improved with updated APIs. At some point I intend to get back to this project and update it for iOS 6 only. Until then, iCloudStoreManager should only be used for applications that have very simple data models.