Build error: 'required' initializer 'init(arrayLiteral:)' must be provided by subclass of 'NSSet'

After converting project from ObjC to Swift and cleanini up all errors. Faced issue with Build errors.

It's reffering for lot's of classes, even empty ones (just class definition), which are not used at all. And I am definetly not using NSSet anywhere.


:0: error: 'required' initializer 'init(arrayLiteral:)' must be provided by subclass of 'NSSet'
Foundation.NSSet:2:33: note: 'required' initializer is declared in superclass here
    required public convenience init(arrayLiteral elements: Any...)


It seems that error is misdealing, but what will be best way to find issue?


Thanks,

David.

Replies

Is this restricted to the project you just converted? Or does it happen if you create a new project from one of the built-in templates?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I have same issue on converted project:


<unknown>:0: error: 'required' initializer 'init(arrayLiteral:)' must be provided by subclass of 'NSSet'
Foundation.NSSet:2:33: note: 'required' initializer is declared in superclass here
    required public convenience init(arrayLiteral elements: Any...)
                                ^
<unknown>:0: error: 'required' initializer 'init(integerLiteral:)' must be provided by subclass of 'NSNumber'
Foundation.NSNumber:2:42: note: 'required' initializer is declared in superclass here
    @nonobjc required public convenience init(integerLiteral value: Int)
                                         ^
<unknown>:0: error: 'required' initializer 'init(floatLiteral:)' must be provided by subclass of 'NSNumber'
Foundation.NSNumber:3:42: note: 'required' initializer is declared in superclass here
    @nonobjc required public convenience init(floatLiteral value: Double)
                                         ^
<unknown>:0: error: 'required' initializer 'init(booleanLiteral:)' must be provided by subclass of 'NSNumber'
Foundation.NSNumber:4:42: note: 'required' initializer is declared in superclass here
    @nonobjc required public convenience init(booleanLiteral value: Bool)


shows for that and 132 another classes:

class DRTogglMenuEvent: DREvent {
}


class DREvent {
    var error: NSError?
}


I do not create DRTogglMenuEvent object but have error.


any ideas?