简体   繁体   中英

How to share Core Data between multiple users?

I am trying to build a simple shared database app for iOS (specifically iPhone for now). The app would let multiple unrelated users on multiple devices add entries to and remove entries from a shared Core Data database that would be searchable by all users. (Ideal product)

I've been searching a lot about iCloud + Core Data but have mostly come across angry rants about how much it sucks. I've looked into Parse but got stuck when trying to use AFNetworking(?). Others have told me to use Amazon Web Services, or to create a simple PHP website to which my app sends its data, or to use carrier pigeons with USB sticks, etc. Somewhere in the rabbit hole I got stuck when trying to use Cocoapods to manage my libraries. Basically, I've been told to do a lot of different things and need to pick one.

I guess a more specific question would be: Do you think Apple's changes to Core Data + iCloud integration this year (WWDC 2013) mean I should try their approach? Or do they suck sufficiently enough that I should try something else?

I saw this previous post, but it seems(?) like its answer is about how to share data between apps rather than between users on different devices: share core data between many users on app

Basically I have no idea what I'm doing and wish I could ask a better question.

I think your best solution is to create a web service (php) with all the required functions (getFromDB, addToDB, removeFromDB,...) and you can use the app to send data and get data from the web service. Hope this helps... Good luck!

If you want to share data between multiple users, you need some kind of online service you can use to store the data. That's all there is to it. It could be a service that provides its own API (like Parse) or one that you roll your own (PHP or whatever server side tech you prefer). Writing your own is not a job for the inexperienced; if you were in a position to create one, you'd already know what to do.

Sharing between different users is not a problem that iCloud was created to solve. I don't know Apple's roadmap, but this option is not there now and I don't think it's likely to appear anytime soon. Using iCloud is orthogonal to the sharing you want-- it might be useful to you for some things, but not for this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM