Note that there are some explanatory texts on larger screens.

plurals
  1. POworking code for my xml
    primarykey
    data
    text
    <p>parssing is going well. but i a not able to get value in 'aBook' object of class 'Book'(whereas aBook have all the property of Book class like 'id','iid','catname','subcatname','url'i.e declared and retained ). what to do get values in aBook?</p> <p>here is output in gdb :</p> <pre> 2011-04-28 15:08:12.046 XML[7053:20b] Processing Element: Table 2011-04-28 15:08:12.047 XML[7053:20b] Processing Value: 2011-04-28 15:08:12.048 XML[7053:20b] Processing Element: id 2011-04-28 15:08:12.048 XML[7053:20b] Processing Value: 1 2011-04-28 15:08:12.049 XML[7053:20b] Processing Value: 2011-04-28 15:08:12.050 XML[7053:20b] Processing Element: catname 2011-04-28 15:08:12.050 XML[7053:20b] Processing Value: Birthday 2011-04-28 15:08:12.051 XML[7053:20b] Processing Value: 2011-04-28 15:08:12.051 XML[7053:20b] Processing Element: iid 2011-04-28 15:08:12.051 XML[7053:20b] Processing Value: 1 2011-04-28 15:08:12.052 XML[7053:20b] Processing Value: 2011-04-28 15:08:12.052 XML[7053:20b] Processing Element: subcatname 2011-04-28 15:08:12.052 XML[7053:20b] Processing Value: card1 2011-04-28 15:08:12.053 XML[7053:20b] Processing Value: 2011-04-28 15:08:12.053 XML[7053:20b] Processing Element: url 2011-04-28 15:08:12.053 XML[7053:20b] Processing Value: http://www.orkutpapa.com/scraps/happy-birthday-card-2-3.jpg 2011-04-28 15:08:12.054 XML[7053:20b] Processing Value: </pre> <p>here id my code:</p> <pre>- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if([elementName isEqualToString:@"NewDataSet"]) { //Initialize the array. appDelegate.books = [[NSMutableArray alloc] init]; } else if([elementName isEqualToString:@"Table"]) { aBook = [[Book alloc] init]; } NSLog(@"Processing Element: %@", elementName); } - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if(!currentElementValue) currentElementValue = [[NSMutableString alloc] initWithString:string]; else [currentElementValue appendString:string]; NSLog(@"Processing Value: %@", currentElementValue); } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if([elementName isEqualToString:@"Table"]) { [appDelegate.books addObject:aBook]; [aBook release]; aBook = nil; } else if([elementName isEqualToString:@"catname"]) { [aBook setValue:currentElementValue forKey:@"catname"]; NSLog(@"elementName for catname....%@",currentElementValue); NSLog(@"aBook for catname....%@",aBook); } else if([elementName isEqualToString:@"subcatname"]) { [aBook setValue:currentElementValue forKey:@"subcatname"]; NSLog(@"elementName for catname....%@",currentElementValue); NSLog(@"aBook for catname....%@",aBook); } else if ([elementName isEqualToString:@"url"]) { [aBook setValue:currentElementValue forKey:@"url"]; // [aBook setValue:currentElementValue forKey:elementName]; NSLog(@"elementName for url....%@",currentElementValue); NSLog(@"aBook for url....%@",aBook); } [currentElementValue release]; currentElementValue = nil; } </pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload