MIME类型的解析器'text / xml charset = utf-8'

时间:2012-02-17 12:11:31

标签: objective-c ios xml parsing restkit

我正在使用restkit,我在解析xml时遇到问题:

Unable to find parser for MIME Type 'text/xml charset=utf-8'
Encountered unexpected response with status code: 200 (MIME Type: text/xml charset=utf-8)

不支持吗?

1 个答案:

答案 0 :(得分:0)

如果您无法修改服务器,只需在RKParserRegistry中使用XML解析器注册mimetype:

[[RKParserRegistry sharedRegistry] setParserClass:[[[RKParserRegistry sharedRegistry] parserForMIMEType:RKMIMETypeXML] class] 
                                      forMIMEType:@"text/xml charset=utf-8"];