-2
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: <#T##IndexPath#>) as! TableViewCell
    cell.myButton. =  recipies[indexPath.row]
}

I don't know what to add after cell.mybutton..

The top part of this code is also labeled as incorrect in Xcode

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Arian
  • 1

1 Answers1

0

nice and simple

cell.myButton.setTitle(recipies[indexPath.row], for: UIControlState.normal)
Russell
  • 5,436
  • 2
  • 19
  • 27
  • 1
    Please don't answer duplicate questions. Instead, flag them as duplicates. – JAL Apr 11 '17 at 16:13
  • It says "Value of type 'UIView' has no member 'setTitle' -- Lol, please help me I'm new to Xcode – Arian Apr 14 '17 at 01:51
  • OK - you have a different problem, and it looks like myButton is **not** actually defined as a UIButton. Could you include the code where you define 'myButton' - either where you create it myButton = UIButton ... or the outlet that you attach to? – Russell Apr 14 '17 at 08:33