Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build a Playlist Browser with Swift Using a Navigation Controller With Segues Modifying the UI

I need help with buttonPressLabel.

My code is exactly like the video. When I enter the code

buttonPressLabel.text = segueLabelText

I get a warning that says 'NSLayoutConstraint' does not have a member named text.

What is happening here? My code is the same as the video....

2 Answers

Iulian Popescu
Iulian Popescu
1,363 Points

If the code from video work properly than your code isn't the same. You should check again your code, but I think that your problem is in Interface builder. The error says that NSLayoutConstraint does not have a member called text, meaning that your buttonPressLabel isn't connected to a label, but to a constraint. Make sure that this IBOutlet is connected right, and if it still not working, leave a message. And, I recommend that next time when you post an issue, post and the code with variables declaration and so on.

Andrew Walz
PLUS
Andrew Walz
Courses Plus Student 5,719 Points

If anybody runs into this issue, it is because when you control click and drag the UIButton to create a IBOutlet, the constraint for the button was clicked instead. Delete the connection and retry it ensuring the control-click lands on the button and the connection it creates is an IBOutlet