iphone - 更改 GDataXML 中的版本

标签 iphone ios xcode4 gdataxml

当我按照本教程使用 GDataXML 生成 XML 时 http://www.raywenderlich.com/725/xml-tutorial-for-ios-how-to-read-and-write-xml-documents-with-gdataxml 并将其保存到文档文件夹中。 从文档文件夹中打开该文件后,它的 xml 版本 =“1.0”。 我想将 xml 版本更改为 2.0。请提出任何更改版本的建议。

最佳答案

在教程中,你有这个,对吧?

GDataXMLDocument *document = [[[GDataXMLDocument alloc] 
        initWithRootElement:partyElement] autorelease];

要将 xml 文档的版本从“1.0”更改为“2.0”,您可以这样做:

NSString *versionString = @"2.0";
const unsigned char *cVersionString = (const unsigned char*)[versionString cStringUsingEncoding:NSUTF8StringEncoding];
document.rootElement.XMLNode->doc->version = cVersionString;

关于iphone - 更改 GDataXML 中的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18097770/

相关文章:

ios - 如何将 Google map 动画设置为当前标记位置并在 Swift 中绘制线条

c# - 我应该将应用程序范围的对象传递给需要它的对象,还是应该使用单例?

objective-c - Xcode 4 窗口问题

objective-c - 为什么这段代码不分配 subview ?

iphone - OTA - 此时无法安装 myApp - 无法验证可执行文件

iphone - INFINITY 划分时的问题是 iOS

ios - 从本地下载 url 图像和 uitableview 单元格图像并在 iOS 中并行执行。如何实现?

iPhone:20 分钟后 MapView 中的应用程序崩溃

iphone - iOS:如果我执行后台作业然后离开 View Controller 会怎样?

iphone - 为什么公共(public) header 会制作多个产品包?