i want switch main story board second view controller. code tried use is
func countcheck(){ if rightanswercount + wronganswercount == 10{ let secondviewcontroller = self.storyboard?.instantiateviewcontroller(withidentifier: "secondviewcontroller") as! secondviewcontroller self.navigationcontroller?.pushviewcontroller(secondviewcontroller, animated: true) } }
when rightanswercount + wronganswercount == 10, program crashed , showed sigabrt error , when scrolled through nslog, states "reason: 'storyboard () doesn't contain view controller identifier 'secondviewcontroller''"
there view called secondviewcontroller don't understand why didn't switch view, should do?
storyboard doesn't contain view controller identifier <youridentifiername>
error means didn't set storyboard id corresponding name.
- go storyboard;
- open inspector view controller;
- set storyboard id
<youridentifiername>
.
Comments
Post a Comment