试图添加一堆对象。这有什么不对?在所有路径上都没有调用self.init吗?
convenience init(testdata: Bool = false) {
if testdata {
let expenses = ["Housing", "Cell Phone", "Utilities", "Auto Insurance","Food", "Netflix","Internet"];
let prices = [600,90,50,106,240,9,60];
for i in 0..<6 {
let expense = expenses[i];
let valueInDollars = prices[i];
self.init(expense: expense, valueInDollars: valueInDollars);
}
} else {
self.init(expense: "", valueInDollars: 0);
}
} <-- Error on this bracket