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 trialboris said
3,607 Points"Use_of_unresolved_identifier_"showPlaylistDetail"
I put the prepareForSegue in the class because it wanted me to get rid the override part if it was outside. The as! twas the fix-it solution for as. Finally, before the error showed up it crashed with the breakpoint on that line. Please help and thank you in advanced. Here is my code for the PlaylistMasterViewController:
āā'
import UIKit
class PlaylistMasterViewController: UIViewController {
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showPlaylistDetail" {
let playlistDetailController = segue.destinationViewController as! PlaylistDetailViewController
playlistDetailController.segueLabelText = "Something"
}
}
@IBOutlet weak var aButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
aButton.setTitle("Press Me!", forState: .Normal)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
This is the code for the MasterDetailController
import UIKit
class PlaylistDetailViewController: UIViewController {
@IBOutlet weak var buttonPressLabel: UILabel!
var segueLabelText: String = ""
override func viewDidLoad() {
super.viewDidLoad()
buttonPressLabel.text = segueLabelText
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}