I need to use a custom struct, I am trying to parse some XML with NSXMLParser, and my idea is to have a struct like so:
Code:
typedef struct {
NSString *tag;
NSMutableString *value;
} currentXMLElem;
// this is placed outside the implementation
And I'd initiate one when I get to a desired tag in the XML, and when I come across and characters I'd progressively add them to the value property.
When I get to EndElement, I'd check if there's a "currentCMLElem" variable initiated, if so, clear it
Loop like this until the end of the XML.
But I can't seem to use my struct, here is a sample:
Code:
// in didStartElement delegate method:
typedef currentXMLElem currentElem;
currentElem.tag = @"someTag";
And right there I get the following error:
error: expected identifier or '(' before '.' token
I don't understand what I need, my tag is a property of the struct, and Xcode even autocompletes with the property name "tag".
What could the error be ?
Hope you can help, thanks