Xcode error: output cannot be connected to re-content

After searching and editing, I can’t find a solution to fix this error. I am trying to associate location search results with a table to display the search results in a list.

I have my map with a details button associated with a UIViewController called "FirstViewController". My results table is linked to a UITableViewController called "ResultsTableViewController". My prototype cells are connected to a UITableViewCell called "ResultsTableCell", which is also where my outputs are located.

Here are two separate errors:

Illegal configuration: The output of nameLabel from ResultsTableViewController to UILabel is invalid. Outputs cannot be connected to repeat content.

Illegal configuration: PhoneLabel exiting ResultsTableViewController to UILabel is invalid. Outputs cannot be connected to repeat content.

I read other people's posts with the same problem, tried to fix them, and I still get the same error.

Here is the code to populate the cell located in my ResultsTableViewController.

let cell = tableView.dequeueReusableCellWithIdentifier("resultCell", forIndexPath: indexPath) as! ResultsTableCell // Configure the cell... let row = indexPath.row let item = mapItems[row] cell.nameLabel.text = item.name cell.phoneLabel.text = item.phoneNumber return cell } 

Code in my ResultsTableCell class:

 import UIKit class ResultsTableCell: UITableViewCell { @IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var phoneLabel: UILabel! } 
+6
source share
2 answers

This message appears only if you connect it to the view controller. As I already commented, you probably did not remove the first connector that you inserted into the controller of your kind. Even if you remove the IBOutlet code from your view controller, you still need to right-click on it and delete the old connection, which probably still exists. After deleting the error message will disappear.

+15
source

this problem occurs when you delete a view from your class but still have a link in your view

here is an example, I remove the link to exit my class, but my view still maintains the link Yellow rectangle Note just removes it by clicking on x

if you want to know how to achieve this view, open your storyboard, right-click in the upper left yellow window, showing this dialog

enter image description here

0
source

Source: https://habr.com/ru/post/986426/


All Articles