Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Macgenie

macrumors newbie
Original poster
Jan 8, 2008
14
0
Suffolk, UK
I work in a small office using 2 Macs on a LAN.

I write applications using Obj C / XCode using Core Data and would like to enable these apps to file share over a LAN. I have scoured the internet and the ADC website in vain looking for support in terms of writing code etc. but so far have seen plenty about sqlite3 etc but nothing specific to ObjC / Core Data.

In essence what I would like to achieve is something similar to File Maker Pro's ability to share files and in fact have had to resort to FM Pro to get my project off the ground. Although FM Pro is a terrific application I would still like to write my own stuff in ObjC - I would then have all the flexibility of designing my own interface and whatever functionality I could dream up. Will I have to write my own file sharing interface or is there an easier route I can go ?

Any pointers will be much appreciated. :)
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Are you wanting the two machines to share a single backing-store? If so, is it possible that they will both be accessing the file at the same time? I don't know how sqlite handles table/row-level locking, etc. so i don't know if this can be done "safely". The number one thing would be where the file is kept. I honestly don't know CoreData at all, so i don't know if you can choose where the sqlite file is stored. If that's easy to do, it seems like having the file on a network share, and the ability to configure where it's stored via a plist, etc. would be your best bet.

Again, my biggest concern would be locking/contention for the file. If sqlite already handles this somehow, you should be fine.

-Lee
 

Macgenie

macrumors newbie
Original poster
Jan 8, 2008
14
0
Suffolk, UK
Sharing Core Dat Files

Thanks for replying Lee; as to your questions I would want to keep the database store on my own hard drive and provide the remote user with a copy of the app (suitably altered to access the shared file) - so yes, I would expect the file to be accessed by more than one user at a time.

I have read up on sqlite3 and concurrency is mentioned in one or two places; also Core Data can use a sqlite database as a backing store so it would seem on the face of it that the tools are all there.

I would also expect to have the same set-up as Filemaker Pro uses, in that if a record is being edited on one machine the system locks that record while the editing is being carried out, but I don't know yet how this would work with Core Data file sharing. I guess this would mean more of an application level function rather than just relying on the file system to police everything.

Your comment on using a plist to store config. data and using a networked shared file set-up sounds good, I think I will set up a small dummy app on both machines and see what happens. Win or lose I will learn something, anyhow.

I have been thinking through several different ideas to get the functionality that I am after and I will start trying these schemes out, I just wondered if this had all been done already and I could save a bit of time! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.