NSInvalidArgumentException - receiver has no segue with identifier

眉间皱痕 提交于 2019-11-27 01:32:23

I was able to fix it by running "clean" under the "Product" menu in Xcode, and resetting the contents and settings in the simulator.

I had this same problem. In my initializer - (id)initWithCoder:(NSCoder *)aDecoder I was doing self = [super init]; when I should have done self = [super initWithCoder:aDecoder];. When I fixed this everything worked as expected.

steepLearningCurve

I had the same problem and struggled with it for hours. Stackmonster's answer solved my problem (rename the storyboard), but I didn't understand why it solved the problem.

I found that when I changed an item on the storyboard (added a label or changed background colour) it was not reflected in the simulator - I wasn't using the storyboard that I could see in xcode, but an older version of the storyboard. I had to rename the storyboard in the project navigator and also rename it in the info.plist (in supporting files) and my label appeared, and the background colour applied, and the segue worked.

I don't know why the storyboard changes weren't taking effect, but it caused me a huge amount of time to find. I've seen on the blogs that a lot of devs have the same problem.

i fixed it! 1. make sure the right storyboard is selected in Xcode(if you rename the storyboard change it in the project summary). then delete the app on the simulator and restart

deleted_user

In Interface Builder you need to set the segue identifier to segue1 which is a segue connected to your view controller.

I tried everything listed and had no luck. What worked was to create a new segue to a new View, then use that one, run it, then create a segue back to the old view.

Had this problem with an unwind segue. Finally realized that I lost my identifier when I replaced a view controller on the storyboard. I re-added it by clicking on the unwind segue in the document outline (sidebar of storyboard), and then in the attributes inspector, add the identifier for it.

If nothing else works, at lease in regards to unwind segues, you can call

[self dismissViewControllerAnimated:YES completion:nil];

I had the same problem as I made new VC as subclass of another view controller. It should be subclass of UIViewController or UITableViewController. Check header file whether UIKIT is being imported or not.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!