运行期间App Delegate上的SIGABRT错误

时间:2016-07-08 17:21:47

标签: iphone swift

我收到以下错误

  

libc ++ abi.dylib:以NSException类型的未捕获异常终止

当我在主故事板上按下解锁按钮时出现问题。它没有按照指示“显示segue”。

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(application: UIApplication,    didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
        return true
    }
}

我的故事板课程是:

import UIKit

class Home: UITableViewController {

var array = ["item1, item2", "item3"]

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

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("customcell")
    as! TableviewCell
    cell.textLabel?.text = array[indexPath.item]
    cell.Title = cell.textLabel?.text!
    return cell
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if(segue.identifier == "datasegue"){
        let cell = sender as! TableviewCell
        let detailview = segue.destinationViewController as! DetailViewController
        detailview.PreTitile = cell.Title
    }
}

0 个答案:

没有答案