@IBOutlet weak var viewHistory: UIView!
@IBOutlet weak var viewGoal: UIView!
override func viewDidLoad() {
super.viewDidLoad()
let tapHistory = UITapGestureRecognizer(target: self, action: #selector(goHistory))
tapHistory.numberOfTapsRequired = 1
tapHistory.numberOfTouchesRequired = 1
tapHistory.isEnabled = true
viewHistory.addGestureRecognizer(tapHistory)
// Do any additional setup after loading the view.
}
@objc func goHistory(){
self.performSegue(withIdentifier: "Segue_History", sender: self)
}
在StoryBoard A中,我将触发的Segues设置为MyPage-> History。 所以我设置了segue标识符“ Segue_History”
当我点击MyPage中的视图时,goHistory函数会调用performSegue。
但是它会发生这样的错误。
2018-11-02 16:43:45.875605+0900
testApp[1729:436205]
-[testApp.VC_History tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x106a83d40
2018-11-02 16:43:45.891627+0900
testApp[1729:436205] *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[testApp.VC_History tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x106a83d40'
我认为我在segue设置了标识符,但事实并非如此。 你有什么想法吗?