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 trialSuresh Koppisetti
3,234 PointsThe label on the PlaylistDetailViewController is not updating per the instructions in this video.
Hi, I have followed the instructions in the lesson to create the variable in the PlaylistDetailViewController to pass information from the master view to the detail view. However this did not work for me. Below is the sample of the code. When I run my project I see the "buttonPressLabel" set to "Testing..." instead of "Testing 1 2 3".
class PlaylistMasterViewController: UIViewController {
....
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showPlaylistDetail" {
let playlistDetailController = segue.destinationViewController as PlaylistDetailViewController
playlistDetailController.segueLabelText = "Testing 1 2 3!"
}
}
}
class PlaylistDetailViewController: UIViewController {
....
var segueLabelText: String = "Testing..."
override func viewDidLoad() {
super.viewDidLoad()
buttonPressLabel.text = segueLabelText
}
}
agreatdaytocode
24,757 PointsCheck the identifier in the storyboard. Make sure it set to "showPlaylistDetail" and not "showPlaylistDetailSegue"
2 Answers
agreatdaytocode
24,757 PointsHello Suresh Koppisetti. Can you tell me what error message you are getting?
I also noticed that your identifier is "showPlaylistDetail" check to make sure it should not be "showPlaylistDetailSegue"
Suresh Koppisetti
3,234 PointsAron, thanks a lot. I had a typo in the name I was using to reference my segue. This is working now.
Thanks again. Suresh
agreatdaytocode
24,757 PointsGlad to help!
Brendan O'Brien
5,521 PointsHOLY COW! I had exactly the same problem but it was INVISIBLE. I only discovered the problem when I copied the segue identifier field and paste it into the code. There was an extra space after the name! Oy! Copying and pasting the complete seque identifier field is what solved the problem. ARGH!
Suresh Koppisetti
3,234 PointsSuresh Koppisetti
3,234 PointsAaron, I actually don't get an error. The code is compiling and when I click the button on the master page which should update the label's text on the detail page, that isn't happening as I expected after watching the video.
Thanks