Exception while parsing
<p>When I build my code I unable to get the data in array!</p>

<p>code:
<pre>
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName 
    attributes:(NSDictionary *)attributeDict {</p>

<pre><code>if([elementName isEqualToString:@"catname"]) 
    appDelegate.books = [[NSMutableArray alloc] init];

else if([elementName isEqualToString:@"subcatname"]) 
           {
        aBook = [[Book alloc] init];
           }        
}
</code></pre>

<p>- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { </p>

<pre><code>if(!currentElementValue) 
    currentElementValue = [[NSMutableString alloc] initWithString:string];
else
  [currentElementValue appendString:string];
</code></pre>

<p>}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {</p>

<pre><code>if([elementName isEqualToString:@"Table"]) 
  {
    [appDelegate.books addObject:aBook];
      [aBook release];
    aBook = nil;
}
else 
{
[aBook setValue:currentElementValue forKey:elementName];
  }
[currentElementValue release];
currentElementValue = nil;
</code></pre>

<p>}</p>

<p>gdb:</p>

011-03-30 16:19:16.661 XML[5671:20b] aBook.Catname.....(null)
2011-03-30 16:19:16.661 XML[5671:20b] Processing Element: iid
2011-03-30 16:19:16.661 XML[5671:20b] Processing Value: 
    5
2011-03-30 16:19:16.662 XML[5671:20b] aBook.Catname.....(null)
2011-03-30 16:19:16.662 XML[5671:20b] Processing Element: subcatname
2011-03-30 16:19:16.662 XML[5671:20b] Processing Value: 
    card5
2011-03-30 16:19:16.663 XML[5671:20b] aBook.Catname.....(null)
2011-03-30 16:19:16.663 XML[5671:20b] Processing Element: url
2011-03-30 16:19:16.663 XML[5671:20b] Processing Value: 
    http://www.orkutgroup.com/scraps/new-year-2.jpg
2011-03-30 16:19:16.664 XML[5671:20b] aBook.Catname.....(null)
2011-03-30 16:19:16.664 XML[5671:20b] aBook.....
2011-03-30 16:19:16.665 XML[5671:20b] appDelegate.books.....(
    
)
2011-03-30 16:19:16.665 XML[5671:20b] aBook.Catname.....(null)

</pre>

<p>What could be the possible reason for this? Help!</p>
