gpt4 book ai didi

ios - 为什么会有 exc_breakpoint?

转载 作者:行者123 更新时间:2023-11-30 14:00:50 71 4
gpt4 key购买 nike

我在 Storyboard的 View Controller 上有一个 TableView Nib ,这样我就可以执行转场。目前,我已将第一个 Nib 放在 View Controller 上,但是当我执行 didSelectRowAtIndexPath 并转至另一个 View Controller 时,我收到 exc_breakpoint 错误。

enter image description here

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let concerts = arrayOfConcerts[indexPath.row]
let artistconcert: ArtistConcerts = self.storyboard?.instantiateViewControllerWithIdentifier("concertartist") as! ArtistConcerts
print(indexPath.row)
self.presentViewController(artistconcert, animated: true, completion: nil)
//artistconcert.
}

以下是 ArtistConcerts 的代码

class ArtistConcerts: UIViewController, UITableViewDataSource, UITableViewDelegate {


@IBOutlet weak var tableartist: UITableView!
var arrayOfArtists: [concert] = [concert]()



override func viewDidLoad() {
super.viewDidLoad()
self.setUpArtists()
self.loadViewFromNib()
let nib = UINib(nibName: "LiveConcerts", bundle: nil)
tableartist.registerNib(nib, forCellReuseIdentifier: "cell")
func loadViewFromNib(){
NSBundle.mainBundle().loadNibNamed("ArtistsConcerts", owner: self, options: nil)
print("in viewcontroller")
}

func setUpArtists(){
let Strokes = concert(imageName: "")
arrayOfArtists.append(Strokes)

}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return arrayOfArtists.count

}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = self.tableartist.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! TableViewCell

let artists = arrayOfArtists[indexPath.row]

cell.setCell(artists.imageName)

return cell

}

}

最佳答案

您似乎在线崩溃了让 ArtistConcert: ArtistConcerts = self.storyboard?.instantiateViewControllerWithIdentifier("concertartist") as!艺术家音乐会

您确定 Storyboard中有一个带有标识符 concertartist 和正确模块名称的 View Controller 吗?

关于ios - 为什么会有 exc_breakpoint?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33016543/

71 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com