I’m trying to parse an XML file, that file contains strings and integers.
So I defined a class, but when I try to assing the parsed value to one of the class’s property which is an intenger I get “this class is not key value coding-compliant for the key aProperty”
aProperty is defined as: NSInteger aProperty;
I parse with NSXMLParser and I tried the following:
aClass.aProperty = [attributeDict objectForKey:@"aProperty"];
aClass.aProperty = [[attributeDict objectForkey:@"aProperty"] intValue];
Couldnt achieve what i wanted with either of those.
the property is written in the xml file as:
<aClass>
<aProperty>12</aProperty>
</aClass>
Thanks in advance
The NSXMLParser’s delegate will receive a
parser:foundCharacters:message. You just need to transform that thosefoundCharactersinto a number.