Error overriding Superclass function in Listing 26.8


#1

The code
override class func autosavesInPlace() -> Bool {
return true
}
generates error “Method does not override any method from its superclass”. and build fails.

What am I missing here?


#2

According to the documentation, autosavesInPlace is a class var not a func.


#3

Thanks. Yes, I saw that in the documentation. But, I was following the “Listing 26.8 Clearing the decks (Document.swift)” in the book “Swift Programming 2nd Edition The Big Nerd Ranch Guide” by Mathew Mathias and John Gallagher.