I have subclassed NSFileWrapper
to specialise it for my own file wrapper while retaining the file handling functionality that NSFileWrapper
offers.
I have not overriden anything and not implemented any of the NSFileWrapper
's initialisers in my subclass. Instead I have provided my own initialiser as appropriate for my file wrapper.
Inside the initialiser, I have used
super.init(URL: url, options: options, error: outError)
and attempted to do documentation = self.fileWrappers["Documentation"] as NSFileWrapper
where documentation
is a NSFileWrapper
property in my subclass. But execution stops at this step saying
fatal error: use of unimplemented initializer 'init(URL:options:error:)' for class 'MyClass'
I don't understand what I am doing wrong. Is NSFileWrapper not meant to be subclassed? Why is it looking for the initialiser in the subclass in the first place?
EDIT: My initialiser is
init(playgroundURL url: NSURL!, options: NSFileWrapperReadingOptions, error outError: NSErrorPointer)
and I am passing nil
to options
and outError
while calling it.