2016-08-21 91 views
0

我想從一個viewController跳轉到另一個。我一直在使用performSegueWithIdentifier,它適用於所有viewController。每次該應用程序試圖執行該segue它打印此錯誤:使用performSegueWithIdentifier()向標識符添加撇號

2016-08-21 15:04:29.170 onboarding[44226:2490189] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver() has no segue with identifier 'gogo''

我在segue中的標識符是「gogo」。同樣在我的代碼中,我使用:

self.performSegueWithIdentifier("gogo", sender: self) 

如果仔細觀察錯誤消息,我注意到Xcode向標識符添加了一個撇號。打印'gogo''而不是'gogo'。這是爲什麼發生?

+1

嘗試xcode→產品→清潔 – Dasem

回答

5

首先它不添加另一個'。看看這個部分接近:

reason: 'Receiver (<onboarding.QuestionnarieVC: 0x7fa919874a00>) has no segue with identifier 'gogo'' 

額外的'是‘接收機....’

你確定你有正確的SEGUE ID設置爲右SEGUE像這樣:

enter image description here

+0

是的我沒有在故事板中設置正確的標識符以及我的代碼。我仍然得到錯誤。我會再次檢查一次,重新制作賽格並清理項目,但我已經完成了。感謝您指出撇號來自 - >'Receiver。這讓我瘋狂。 –