我有几个关于相同代码播种的问题
如果我得到一个不寻常的XML,它与我的app阻止的对象类型不匹配;
有关我的代码的任何其他建议将不胜感激。 我的代码:
xmlTextReaderPtr reader = xmlReaderForMemory([DecryResponse bytes], [DecryResponse length], NULL, NULL, (XML_PARSE_NOBLANKS | XML_PARSE_NOCDATA | XML_PARSE_NOERROR | XML_PARSE_NOWARNING));
NSString * currentTagName =nil;
NSString * currentTagValue= nil;
char *temp = nil;
while (true) {
if(!xmlTextReaderRead(reader))break;
switch (xmlTextReaderNodeType(reader)) {
case XML_READER_TYPE_ELEMENT:
temp = (char *)xmlTextReaderConstName(reader);
currentTagName =[NSString stringWithCString:temp encoding:NSUTF8StringEncoding];
continue;
case XML_READER_TYPE_TEXT:
temp =(char *)xmlTextReaderConstValue(reader);
currentTagValue = [NSString stringWithCString:temp encoding:NSUTF8StringEncoding];
if ([currentTagName isEqual:@"Account"]) {
SW.Account =[currentTagValue intValue];}
if ([currentTagName isEqual:@"SessionNumber"]) {
SW.SessionNumber = currentTagValue; }
if ([currentTagName isEqual:@"OpCode"]) {
SW.OpCode = [currentTagValue intValue];}
default:continue;
}
}