JDP 發表於 2015-12-24 12:52:49

Objective C iOS NSXMLParser does not support reentrant parsing

iOS8後會碰到 NSXMLParser does not support reentrant parsing 的問題,造成錯誤無法執行。

只要使用 dispatch_queue 另開Thread去執行parse即可解決:
            dispatch_queue_t reentrantAvoidanceQueue = dispatch_queue_create("reentrantAvoidanceQueue", DISPATCH_QUEUE_SERIAL);
            dispatch_async(reentrantAvoidanceQueue, ^{
            self._tmpXMLString = [ init];
            xmlParserS = [initWithData:];
            xmlParserS.delegate = self;
            ;
            });
            dispatch_sync(reentrantAvoidanceQueue, ^{ });

Reference:
http://www.4byte.cn/question/2388969/nsxmlparser-on-ios8-nsxmlparser-does-not-support-reentrant-parsing.html
http://www.bubuko.com/infodetail-567603.html
頁: [1]
查看完整版本: Objective C iOS NSXMLParser does not support reentrant parsing