views:

42

answers:

2

Hi! I'm coding an app with core data. I need to sync the database between two iphones running the same app maybe via bonjour... Can anyone help?

Thankyou!

A: 

I would suggest using cocoahttpserver for the basic network communication. Now you can either

  • copy your sqlite file if used in CoreData

or

  • use some exchange-format (xml, json) on top of the server communication.

I myself would consider idea one being quite bad in most situations, also it might fit for your use-case.

With idea two you will have more work but more control about the data representation on each phone.

Actually we are using idea two in my company. But I can't post any code here.

vikingosegundo
A: 

I believe this video can help: http://www.mac-developer-network.com/video/video101028.html

source: http://github.com/mzarra/ZSync

BobC