我做XMLParsing我的應用程序後,將返回空值。爲了得到字典中的解析值,我使用了XMLReader.h
和XMLReader.m
文件。它適用於所有Web服務,但返回null
。它給了我正確的XML格式的迴應。的NSDictionary解析
這裏就是我得到的字典
-(void)parser:(NSXMLParser *) parser foundCharacters:(NSString *)string
{
if(elementFound)
{
[soapResults appendString:string];
NSLog(@"soap result of hotel is %@",soapResults);
NSError *parseError = nil;
NSDictionary *xmlDixtionary = [XMLReader dictionaryForXMLString:soapResults error:&parseError];
NSLog(@"dictionary is is %@",xmlDixtionary);
}
}
值的代碼,但在日誌給我一個null
值,我應該怎麼做才能在詞典中的值?
嘗試登錄parseError:的NSLog(@ 「%@」,parseError); –
它給了我這個錯誤錯誤域= NSXMLParserErrorDomain代碼= 5「的操作無法完成。(NSXMLParserErrorDomain錯誤5)」 – Purva
不soapResults有一定的價值?嘗試nslogging也.. –