1 Reply
      Latest reply: Dec 3, 2016 6:14 AM by eskimo RSS
      nmdias Level 1 Level 1 (0 points)

        I'm trying to have this fixed. It's clearly a bug. I've already submited a bug report (28904764) and a Radar, but never had any bugs closed and fixed. They just stay there indefinitely in the bug report portal. So, maybe some exposure will help?

         

        I tried to isolate the issue:

         

        This works:

         

        if let parser = XMLParser(contentsOf: feedURL) { 
             print("Got instance \(parser)") 
        }
        
        

         

        This does not:

         

        class Parser: XMLParser { } 
        
        if let parser = Parser(contentsOf: feedURL) { 
             print("Got instance \(parser)") 
        }
        
        

         

        It's clean project, with nothing but those lines of code. The issue appears to happen only to subclasses of the XMLParser.

         

        Can we ger a fix for this?

        • Re: XMLParser crashes when trying to parse a feed URL offline
          eskimo Apple Staff Apple Staff (6,310 points)

          You should look at this thread.  To summaries:

          • It does indeed like this this is a bug in how Swift’s XMLParser interacts with the Objective-C NSXMLParser.  Thanks for filing a bug about that.

          • Most folks don’t notice this because most folks don’t subclass XMLPaser (or NSXMLParser, for that matter) but instead use it via its delegate, which is what I recommend you do.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"