iPhone Mac application communication
Hello,
I would like to implement a synchronization mechanism between an iPhone and a Mac application, but I'm not sure how this can be achieved best. The user should connect his iPhone using internet or a wireless network and send some data to the Mac application. Another solution would be using a data cable, cut I'm not sure if this is possible.
Thank you,
Bogdan
Well, both the iPhone and the Mac can access the internet, so why bother with wires? The iPhone can 'talk' directly to your Mac's Apache web server provided it's visible on the internet (which by default it almost certainly is not).
I don't know what type of synchonization application you have in mind. I have a dropbox account to sync copies of my photos to various machines and I believe dropbox offers iPhone sync - so perhaps that'll meet your needs immediately. Drop offer a free 2GB account so you can try it out.
Can you explain a little more about what you need and want to achieve?
Thanks for your response.
Basically, I have built a Core Data application, which tracks various user data. I would like to build an iPhone app, that people could use when they aren't in front of their computer, to register some data (like consumed foods, or weight). Later, the users should be able to import the data from the iPhone to the Mac application.
So the iPhone application needs to pull some data from the Mac application and then send the registered user data to the Mac application.
Bogdan
Take a look at this:
http://developer.apple.com/iphone/library/documentation/DataManagement/Conceptual/iPhoneCoreData01/Articles/01_StartingOut.html
It seems that dropbox and coredata/persistant storage could be a solution.
http://mashable.com/2009/09/29/dropbox-iphone/
Mind you, the persistant storage stuff looks quite formidable. However I've never used it and I'm probably quite mistaken as most of the cocoa stuff is really good once you understand how it works.
As an alternative for storage, I found this tutorial about reading/writing data from cocoa with NSKeyArchiver:
http://cocoadevcentral.com/articles/000084.php
So, I think if you put this all together, you'll probably be happy. The nice thing about this is that you don't get involved with the network/security business. Your app is simply reading/writing local files which will be sync'ed by the dropbox guys.
Incidentally, I had to make (simple) changes to Scott's tutorial code. If you're stuck in getting that to work, please let me know and I'll give you my version.