BasicPhrasesVC adında bir ViewController sahibiyim ve bir sonraki ViewController'da (BasicPhrasesVC) görüntülemek için verileri seçilen hücreye aktarmak istiyorum. Ben buraya koymak için emin değilimReadyForSegue'i nasıl hızlı kullanabilirim?
class BasicPhrasesVC: UIViewController, UITableViewDataSource, UITableViewDelegate {
let basicPhrases = ["Hello.","Goodbye.","Yes.","No.","I don't understand.","Please?","Thank you.","I don't know."]
var selectedBasicPhrase = ""
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return basicPhrases.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell")!
cell.textLabel?.text = basicPhrases[indexPath.row]
return cell
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
Herhangi bir yardım takdir
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
selectedBasicPhrase = basicPhrases[indexPath.row]
performSegueWithIdentifier("BasicPhrasesVC2BasicDisplayVC", sender: self)
}
}
(ı değişkeni "selectedBasicPhrase" aktarmak istiyorum). destinationViewController
alıp ona sen veri göndermek daha
teşekkürler "türü değerini belirtilen türe 'BasicDisplayVC' 'BasicPhrasesVC' dönüştürme olamaz" ile . –
destinationViewController hedefe yeniden adlandırıldı. –