将数据存储到我的应用程序中的xml [英] Store data to xml in my app
本文介绍了将数据存储到我的应用程序中的xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将我的数据(我通过我的应用程序收集)存储到xml,然后发送到我的网络空间。
我应该怎么做
i want to store my data (which i am gathering through my app) to xml and then send it to my webspace. How should i do it??
推荐答案
您的问题包含几个任务。
Your question contains several tasks.
这是上传部分的解决方案:
Here is a solution for the upload part:
在服务器端,您需要进行文件上传。
On sever-side you need to have a file-upload.
在iOS端我建议使用 ASIHttpRequest
On iOS-side I suggest the usage of ASIHttpRequest
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setFile:@"path/to/ur/xml" forKey:@"file"];
编辑
创建一个简单的XML文件应该很容易,因为它可以通过String操作完成。
Creating a (simple) XML-file should be quite easy, as it can be done just with String-operations.
- 填充(mutable)具有要写入xml的对象的数组
- 假设您有一个收集的地址簿数据。
每个联系人有n个地址,存储在数组中,名称为...
- fill a (mutable) Array with the objects you want to write to the xml
- let's say, you have a collected address book data. you filled the array with Contacts objects
- each contact has n addresses, that are stored in an array, a name,...
这篇关于将数据存储到我的应用程序中的xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文