objective c - IOS Open New View controller Programatially -


i need open registration form on application programatically, view controller created on storyborad storybpard id viewcontrollerregister , code have used open form

registrationformviewcontroller *registerview = [self.storyboard instantiateviewcontrollerwithidentifier:@"viewcontrollerregister"];           [self presentviewcontroller:registerview animated:no completion:nil]; 

but when run application, getting error like,

terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[__nsarraym insertobject:atindex:]: object cannot nil' * first throw call stack:

1) make sure storyboardname "main" or different.

enter image description here

2) check have entered proper storyboard identifier.

enter image description here

and finally,

3) xcode can't able find storyboard self.storyboard. try mention storyboard actual name like,

uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:[nsbundle mainbundle]];          registrationformviewcontroller *registrationformviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"registrationformviewcontroller"];         [self presentviewcontroller:registrationformviewcontroller animated:yes completion:nil]; 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -