The textField outlet from the ChecklistViewController to the UILabel is invalid. Outlets cannot be connected to repeating content. [12]

Can anyone help me out…When I make a static cell, textfield then attempt to create an outlet, I get this error. Nothing is repeating… However when I look at the code from IOS Apprentice book, seems to run fine… I checked stackOverflow. and tried subclassing the tablecell… but that didnt work… Anyone see this before…? "The textField outlet from the ChecklistViewController to the UILabel is invalid. Outlets cannot be connected to repeating content.

I decided to stop trying to fix the problem and move on to start chapter 13…

I’m not sure what you are doing, so I will describe what you should have.

The ChecklistViewController on the storyboard has its class set to “ChecklistViewController.” It has the table view set to “Dynamic Prototypes” on the storyboard. It should have one cell displayed under Prototype Cells when you look at. Below that it should say “Table View” and “Prototype content”.
The cell contains a label, and that label cannot be connected to an outlet, because there will be several rows, each with their own label. The label gets filled for each row by the configureCell(…) method in the ChecklistViewController class code.

The AdditemViewController on the storyboard has its class set to “AdditemViewController.” It has the table view set to “Static Cells” on the storyboard. It should have one static cell, and below that it should say “Table View” and “Static content”.
That one cell is type “Custom”, and should contain a label. The label can be connected to an outlet. It should be named textField, and should be connected to an outlet in the AdditemViewController class (not the ChecklistViewController class).

One of these things is not correct in your storyboard. Maybe you are trying to connect the label on the AdditemViewController to an outlet in the ChecklistViewController class. You might not have the right class assigned to each controller. Or you might not have the AdditemViewController table set to Static Cells. I can’t tell which thing is.

1 Like

Thanks so much for the detailed reply.
I was working on a small monitor so seeing only one screen at a time i accidentally created a label from the ChecklistViewController thats why I got the error message. The thing was I never thought to check there and spent and hour on the AddItem screen. I guess I learned about debugging that day, thank you again

This topic was automatically closed after 166 days. New replies are no longer allowed.