Best way to save XML file on iPhone?

I use MonoTouch as well as System.Data to create a DataSet (just xml for those who are not familiar) for simple data binding. My application data is minimal, so no need to deal with SQLLite. Using a dataset makes it easy to navigate through web services for cloud synchronization.

I serialize the DataSet to a personal folder when saving and, of course, read this file when the application starts loading user data. I had problems when this file becomes corrupt, and I'm not sure why. I assume that on these devices there may be slow file input / output, and this may be the reason, I'm not sure, but it does.

I am also worried that maybe iTunes transfers this file between PC / MAC when the user synchronizes their devices with iTunes, what could be the cause of corruption?

I want this device file not to sync with iTunes, and also save it securely. I use the NSFile.Save parameter to save it to the device. I think, since this is a text file, maybe I could more safely store it in the standard user settings area? I would suggest that this will prevent itunes from syncing?

What is the most reliable and secure way to handle this input / output file for xml data warehouse?

Thank.

+3
source share
4 answers

MonoTouch. DataSet.WriteXml() FileStream, ""?

"" iTunes. , , ( , , ). , .

, , , - , , . , , .

, . , , . , .

, , , . , , , , .

, , , sqlite.

+2

XML . , File.WriteAllText(...) - NSFile . MonoTouch:)

, :

  • (Environment.SpecialFolder.MyDocuments Environment.SpecialFolder.Personal BOTH doc), , iTunes.

. , - , . XML , , .

iTunes, , . . , , .

:

  • . .

  • . .

iTunes . , iOS . dev - , , , iOS.

, .

, , , , .

iOS - , ( ) . , 5000 , - ( , ... ). , , - ( , , , , - (UI) -).

, .

, :)

+2

, , GDataXMLNode http://code.google.com/p/gdata-objectivec-client/ /.

, iPhone , Core Data SQLLite.:-) Apple ,

0

SQLite, -

entify - , , - .

Saving XML on iPhone as a means of storing and accessing data is something you don’t want to enter. I wrote about it here http://iwayneo.blogspot.com/2010/08/festival-star-history-serialization-as.html

0
source

Source: https://habr.com/ru/post/1765358/


All Articles