سؤال

I am using restkit and I have problems parsing an 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)

Isn't it supported?

هل كانت مفيدة؟

المحلول

If you can't modify the server just register the mimetype with XML parser in RKParserRegistry:

[[RKParserRegistry sharedRegistry] setParserClass:[[[RKParserRegistry sharedRegistry] parserForMIMEType:RKMIMETypeXML] class] 
                                      forMIMEType:@"text/xml charset=utf-8"];
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top