Thursday, September 08, 2011

Gdata XMl Parsing simply

This is very simple
 
xmlFileLocation = [[NSBundle mainBundle]pathForResource:@"Cars" ofType:@"xml"];
 
 NSData *xmlData = [NSData dataWithContentsOfFile:xmlFileLocation];
 
 GDataXMLDocument *xmlDocument   = [[GDataXMLDocument alloc]initWithData:xmlData options:0 error:&error];
 
NSArray *getData = [[xmlDocument rootElement]elementsForName:@"car"];
 
NSInteger type = [[(GDataXMLNode *) [[urls objectAtIndex: i] attributeForName: @ "type"] stringValue] intValue];





How to Parse a attribute using GDATA xml Parser

NSInteger type=[[(GDataXMLNode *)[[urls objectAtIndex:i] 
 attributeForName:@"type"] stringValue] intValue];
 NSInteger bit_stream=[[(GDataXMLNode *)
[[urls objectAtIndex:i]attributeForName:@"bit_stream"] 
stringValue] intValue];

Swift Operators - Basic Part 3 (Range operators in swift)

Range Operators: Closed Range operators  Half-Open Range Operators One-Sided Ranges Closed Range Operators:  a...b It defines...