I am trying to parse the issue of where the parsing framework ( FeedKit ) is if there is no connection to get the contents of the specified URL (for example, the application is disconnected).
So, it works when the application is connected to the network, and only on the Internet.
Whenever I try to create an instance of the Parser
class using the convenience initializer of the XMLParser
superclass
convenience init?(contentsOf url: URL)
Structure Failure:
To try to isolate the problem and eliminate some errors introduced into the structure, I recreated the problem in a clean project:
A solution that works like a charm using the Foundation Foundationโs simple valid XMLParser:
let feedURL = URL(string: "http://images.apple.com/main/rss/hotnews/hotnews.rss")! if let parser = XMLParser(contentsOf: feedURL) { // Works as expected print("Got instance \(parser)") }
And another thing that does not:
class Parser: XMLParser { } let feedURL = URL(string: "http://images.apple.com/main/rss/hotnews/hotnews.rss")! if let parser = Parser(contentsOf: feedURL) {
In the second example, all I'm doing is a subclass of the XMLParser
class. No overrides or custom code. And he still falls.
Did I miss something?
thanks
Edit:
I sent an Apple bug report with the number 28904764 and opened Radar for this problem.
I am sure that this is a mistake at the end of Apple, but would prefer to make mistakes and fix it.
source share