ViewController.Type does not have a member named 'name'

13 views
Skip to first unread message

SERGIO 9999

unread,
Apr 15, 2015, 10:23:20 AM4/15/15
to swift-l...@googlegroups.com
Inside my ViewController I'm creating a new Object that takes in a 2 dimensional array as a parameter. The array is declared above the instantiation of the Object. But I get an error on the line the Object is instantiated in that says "ViewController.Type does not have a member named '(name of the array)'". Any help would be appreciated. Here is the piece of code:

var arrayForMaze:[[Piece!]] = [[Piece2(),Piece4(),Piece8(),Piece7(),Piece8(),Piece4(),Piece13(),Piece8()],

                                [Piece9(),Piece2(),Piece9(),Piece9(),Piece5(),Piece8(),Piece9(),Piece1()],

                                [Piece11(),Piece14(),Piece15(),Piece6(),Piece2(),Piece1(),Piece11(),Piece3()],

                                [Piece1(),Piece2(),Piece5(),Piece10(),Piece14(),Piece13(),Piece12(),Piece2()],

                                [Piece7(),Piece14(),Piece13(),Piece3(),Piece2(),Piece1(),Piece11(),Piece12()],

                                [Piece1(),Piece2(),Piece9(),Piece4(),Piece15(),Piece10(),Piece12(),Piece1()],

                                [Piece4(),Piece15(),Piece14(),Piece10(),Piece6(),Piece2(),Piece5(),Piece8()],

                                [Piece4(),Piece14(),Piece3(),Piece4(),Piece10(),Piece14(),Piece10(),Piece6()]]

    

    let maze1:Maze! = Maze(myArray: arrayForMaze, startR: 1, startC: 2, endR: 7, endC: 6)         //This is the line with the error
Reply all
Reply to author
Forward
0 new messages