我不知道如何使用GDataXML创建XML文档,也找不到任何好的链接来帮助me.Please告诉我如何执行此操作或提供一些好的链接。
发布于 2012-11-08 14:43:28
请看http://www.raywenderlich.com/725/how-to-read-and-write-xml-documents-with-gdataxml教程。它会帮到你的。
发布于 2012-11-08 16:44:32
首先,创建XML值并将其存储为字符串。然后使用以下方法在文档目录中创建xml文件。
//方法将字符串写入xml文件
-(void) writeToXMLFile:(NSString *)content
{
//get the documents directory:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
//make a file name to write the data to using the documents directory:
NSString *fileName = [NSString stringWithFormat:@"%@/xmlfile.xml",documentsDirectory];
//save content to the documents directory
[content writeToFile:fileName atomically:NO encoding:NSStringEncodingConversionAllowLossy error:nil];
}https://stackoverflow.com/questions/13283840
复制相似问题