Reputation: 924
I have this piece of code that was working fine with xcode6 and after upgrading to xcode7 I am getting the following error
var levels:[(
level: Int,
activeButtons: [UIButton],
numberOfButtons: Int,
timer: [Int],
blinks: [Int],
score: [Int],
subIndex: Int,
image: String,
bunce : Int,
speed: Double
)] = []
levels.append(level:1, activeButtons:[], numberOfButtons:2, timer:[0,10,8,5],blinks:[0,2,3,4], score:[0,100,150,200], subIndex: 0, image: "blue", bunce: 150, speed:0.6)
Error I am getting is
Cannot invoke 'append' with an argument list of type '(level: Int, activeButtons: [UIButton], numberOfButtons: Int, timer: [Int], blinks: [Int], score: [Int], subIndex: Int, image: String, bunce: Int, speed: Double)'
1. Expected an argument list of type '(Element)'
Upvotes: 0
Views: 71
Reputation: 12617
It needed another braces around the element you are adding...
var levels:[(
level: Int,
activeButtons: [UIButton],
numberOfButtons: Int,
timer: [Int],
blinks: [Int],
score: [Int],
subIndex: Int,
image: String,
bunce : Int,
speed: Double
)] = []
levels.append((level:1, activeButtons:[], numberOfButtons:2, timer:[0,10,8,5],blinks:[0,2,3,4], score:[0,100,150,200], subIndex: 0, image: "blue", bunce: 150, speed:0.6))
Upvotes: 1