Joshua
Joshua

Reputation: 15500

How do you sync a Core-Data application between a Mac and a iPhone?

Just wondering what code I would need to do this?

Upvotes: 1

Views: 1111

Answers (2)

wbyoung
wbyoung

Reputation: 22493

There's no CoreData for the iPhone (yet), so there's no way to use the same code in your iPhone and Mac app. You could write your own wrapper around sqlite that will run on both. The Omni group has an open source version of this (under a modified MIT license) which would probably be a good starting point.

In addition, there's no built in way to sync data, so you'll have to come up with a way to do that as well. Many apps run a server on the phone/mac and sync via that server. It generally requires that your phone is connected to the same wifi network as the mac.

Upvotes: 1

Boaz Stuller
Boaz Stuller

Reputation: 2544

Core Data does not exist on the iPhone, so you'll need to use something else for the iPhone portion at least. In fact, if you want to share a significant amount of code between the iPhone and Mac apps, you'll probably want to avoid Core Data altogether.

Upvotes: 1

Related Questions