以编程方式切换视图时Swift NSInvalidArgumentException

时间:2016-04-24 19:59:40

标签: ios swift

我正在使用此Swift代码以编程方式切换视图:

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    let message = messageArray[indexPath.row]
    print ("messageClickAction executed. MessageID " + message.getMessageID())

    let viewController = storyboard?.instantiateViewControllerWithIdentifier("viewMessage")
    self.navigationController?.pushViewController(viewController!, animated: true)
}

抛出此异常:

  

由于未捕获的异常而终止应用   'NSInvalidArgumentException',原因:' - [UIView _setRefreshControl:]:   无法识别的选择器发送到实例0x13fdc6e20'

ViewMessageController:

import UIKit

class ViewMessageController : UITableViewController {

@IBOutlet weak var messageSender: UILabel!
@IBOutlet weak var messageTimestamp: UILabel!
@IBOutlet weak var messageContent: UILabel!

override func viewDidLoad() {
    print ("View loaded.")
 }
}

知道如何修复此异常吗?谢谢!

0 个答案:

没有答案