I am trying to index into an array of functions but I get the error: \"Expression resolves to an unused l-value\". I have tried to google what this means but information is
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell:UITableViewCell = myTableView.dequeueReusableCellWithIdentifier("cell") as UITableViewCell
var chart = cell.contentView.viewWithTag(42) as TKChart
chart.delegate = self
chart.removeAllData(); //needed because of cell recycling
var userDef1 = 1
var userDef2 = 1
func lineChart() -> TKChart {...}
func columnChart() -> TKChart {...}
var chartsArray = [AnyObject]()
if userDef1 == 1{
chartsArray.append(lineChart)
}
if userDef2 == 1{
chartsArray.append(columnChart)
}
if indexPath.row == 0{
chartsArray[0]()
}
if indexPath.row == 1{
chartsArray[1]()
}
return cell
}
chartsArray[0]
is analagous to writing just the result of lineChart()
; you're identifying a value, but not actually doing anything with it.