Xcode 使用GData库更新节点

Xcode 使用GData库更新节点,xcode,ios4,xml-parsing,gdata-api,objective-c-2.0,Xcode,Ios4,Xml Parsing,Gdata Api,Objective C 2.0,您好,我正在使用Gdata库,我被困在一个地方,我想从xml节点更新特定的数据。下面是我试图更新的代码 -(void)UpdateTheXMLNode { NSArray *docdirpath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *fileLoc = [[docdirpath objectAtIndex:0] stringByApp

您好,我正在使用Gdata库,我被困在一个地方,我想从xml节点更新特定的数据。下面是我试图更新的代码

-(void)UpdateTheXMLNode { NSArray *docdirpath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *fileLoc = [[docdirpath objectAtIndex:0] stringByAppendingPathComponent:@"SomeXML.xml"]; NSData *xmlData = [NSData dataWithContentsOfFile:fileLoc]; GDataXMLDocument *doc = [[GDataXMLDocument alloc]initWithData:xmlData options:0 error:nil]; NSArray *a = [doc.rootElement elementsForName:@"row"]; NSLog(@"data before = %@",[[[a objectAtIndex:0] childAtIndex:1]stringValue]); [[[a objectAtIndex:0] childAtIndex:1]setStringValue:@"Yahooo"]; [a writeToFile:fileLoc atomically:YES]; NSLog(@"data after = %@",[[[a objectAtIndex:0] childAtIndex:1]stringValue]); } -(void)UpdateTheXMLNode { NSArray*docdirpath=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,是); NSString*fileLoc=[[docdirpath objectAtIndex:0]stringByAppendingPathComponent:@“SomeXML.xml”]; NSData*xmlData=[NSData dataWithContentsOfFile:fileLoc]; GDataXMLDocument*doc=[[GDataXMLDocument alloc]initWithData:xmlData选项:0错误:nil]; NSArray*a=[doc.rootElement elementsForName:@“row”]; NSLog(@“前面的数据=%@,[[a objectAtIndex:0]childAtIndex:1]stringValue]); [[a objectAtIndex:0]childAtIndex:1]setString值:@“Yahooo”]; [a writeToFile:fileLoc原子性:YES]; NSLog(@“data after=%@,[[a objectAtIndex:0]childAtIndex:1]stringValue]); } 但是,唉,它现在给了我任何结果,所以请帮我解决它