ios - Application tried to push a nil view controller on target -
i got below error:
application tried push nil view controller on target uinavigationcontroller: 0x7b98940.
it caused when 'click' cell of uitableviewcontroller
. code:
#pragma mark - table view delegate - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { verifyinfoviewcontroller *verifyinfovc = [self.storyboard instantiateviewcontrollerwithidentifier:@"verifyinfovc"]; [self.navigationcontroller pushviewcontroller:verifyinfovc animated:yes]; }
this error means viewcontroller
has not been allocated properly, , guess self.storyboard
nil, if yes means didn't initialise master viewcontroller
, can below trick:
uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:[nsbundle mainbundle]];
Comments
Post a Comment