Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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