I have declared an NSMutableArray *categories
in my view controller .h file, and declared a property for it.
In the parser:foundCharacters:
method of the NSXMLParser
delegate in my .m file, I have this code:
-(void)parser:(NSXMLParser *) parser foundCharacters:(NSString *)string
{
if (elementFound)
{
element = string;
[self.categories addObject:element];
}
}
But when I hover over the [self.categories addObject:element]
line after stepping into it in debug mode, XCode tells me the size is 0x0, 0 objects. There are 3 elements in my XML file so 3 items should be in the array.
I'm missing something really obvious and I can't figure out what.