1

I put one label text in my Table View row. Then Ctrl dragging to the ViewController.swift but error occurs. How to solve this problem? My Xcode version is 7.3.

enter image description here

May Phyu
  • 895
  • 3
  • 23
  • 47
  • Read something about table view controllers in iOS. It doesn't make any senses to connect a label in a cell to a view controller. – dasdom Apr 23 '16 at 10:53
  • I'm not clear what you want to say. I put just label and dragging to connect. Then, error occurs "Illegal Configuration: The lbltest outlet from the ViewController to the UILabel is invalid. Outlets cannot be connected to repeating content. " – May Phyu Apr 23 '16 at 11:10
  • Exactly. Labels within table view cells need to be connected to outlets in subclasses of `UITableViewCell`. – dasdom Apr 23 '16 at 11:30
  • Possible duplicate of [Outlets cannot be connected to repeating content iOS](http://stackoverflow.com/questions/26561461/outlets-cannot-be-connected-to-repeating-content-ios) – Khadija Daruwala Jul 20 '16 at 04:16

1 Answers1

1

You must connect the @IBOutlet into tableView cell class not in the main class. first of all you must make the custom class of tableview cell and assign it on storyboard as suggested in picture and draw @IBOutlet on that custom tableview cell class. Please look the attached image. Image1

image2image3image4

Hope it will help you.

Amrit Tiwari
  • 922
  • 7
  • 21