PDA

View Full Version : iPhone SDK: Making application files stay




supersv
Apr 19, 2008, 09:04 AM
Hi,

Does anybody know how to make files inside an iPhone SDK app's directory survive simulator restart? The problem is Xcode puts the application under a random folder in ~/Library/Application Support/iPhone Simulator/User/Applications/ during each launch, and any files the app stored during the previous session are gone.

Thanks.



Littleodie914
Apr 19, 2008, 10:59 AM
Hi,

Does anybody know how to make files inside an iPhone SDK app's directory survive simulator restart? The problem is Xcode puts the application under a random folder in ~/Library/Application Support/iPhone Simulator/User/Applications/ during each launch, and any files the app stored during the previous session are gone.

Thanks.I'm not really sure, I've wondered the same thing.

And on a related note, how is application going to be maintained after an application upgrade? :confused:

supersv
Apr 19, 2008, 11:43 AM
I've got a temporary solution, to ease the debugging. The idea is to use external commands to copy files when application starts and store them away when it is about to terminate. It's kinda ugly, but it works.

Monkaaay
Apr 19, 2008, 10:50 PM
Would serializing to SQLite work for your app?

supersv
Apr 20, 2008, 05:16 AM
Would serializing to SQLite work for your app?

Yes, it would, but doesn't SQLite store its data inside a file in app's dir as well?

Monkaaay
Apr 20, 2008, 10:12 AM
Yes, it would, but doesn't SQLite store its data inside a file in app's dir as well?

I'm not sure. If it does and those files were removed, it doesn't seem very useful to have SQLite available.

supersv
Apr 20, 2008, 11:17 AM
I'm not sure. If it does and those files were removed, it doesn't seem very useful to have SQLite available.

It depends on how well your data fit the relational model.

Monkaaay
Apr 20, 2008, 11:20 AM
What does that matter if the DB file is blown away every time your app exits?

supersv
Apr 20, 2008, 12:33 PM
What does that matter if the DB file is blown away every time your app exits?

It is blown away only when Xcode reinstalls your app in the simulator. When the app eventually gets to a real device, files will stay.