我试图为我做一个最简单和最令人困惑的事情,直到现在我想开发自己的应用程序,为了做到这一点,我需要能够传递一些信息,具体取决于用户点击哪一行(它是Swift lenguage)
我们有一个RootViewController(表视图)和一个DetailViewController(带有1个标签和1个图像)

(我们的观点)
这是代码:
@IBOutlet weak var tableView: UITableView!
var vehicleData : [String] = ["Ferrari 458" , "Lamborghini Murcielago" , "Bugatti Veyron", "Mercedes Benz Biome"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
var nib = UINib(nibName: "TableViewCell", bundle: nil)
tableView.registerNib(nib, forCellReuseIdentifier: "cell")
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return vehicleData.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell:TableViewCell = self.tableView.dequeueReusableCellWithIdentifier("cell") …Run Code Online (Sandbox Code Playgroud)