Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.1 Swift issue - 'init()' is unavailable: superseded by import of -[NSObject init]

I have just upgraded my Xcode to 6.1 an am now getting a strange compilation error.

'init()' is unavailable: superseded by import of -[NSObject init]

I am subclassing SCNNode and have a optional references to other classes of the same type I am defining. i.e.

import UIKit
import SceneKit

    class BayNode: SCNNode {

        var leftBay:BayNode?
        var rightBay:BayNode?


        func addLeftBay()
        {

            leftBay = BayNode()   // 'init()' is unavailable: superseded by import of -[NSObject init]

        }


    }

Does anybody know how I can resolve this.

Many Thanks

like image 777
BassetMan Avatar asked Oct 26 '14 09:10

BassetMan


1 Answers

I have same problem, one way I found to suppress the error is to explicitly cast it:

leftBay = BayNode() as BayNode
like image 55
Alex-alex Avatar answered Nov 11 '22 02:11

Alex-alex