nmdias / FeedParser

An RSS and Atom feed parser written in Swift
MIT License
11 stars 1 forks source link

FeedParser issue #1

Closed JoshuaEpl closed 8 years ago

JoshuaEpl commented 8 years ago

In the Core folder. The FeedParser.swift file.

Error: All stored properties of a class instance must be initialized before returning nil form an initializer

I am using xcode version 7.2 if that helps.

public init?(URL: NSURL) {

    guard let parser = Parser(contentsOfURL: URL) else {

//This line gives me a error. -------> return nil }

    self.parser = parser

}
nmdias commented 8 years ago

It does help, it is a known issue of Xcode 7.2, where all properties of an instance must be initialized before nil is returned. However, this does not make sense if, for whatever reason, you need to return nil in a failable initializer before doing so.

This was fixed in Xcode 7.3