ios - how to call View controller of MainStoryBoard from UI cellView xib -


the problem want call view controller of mainstoryboard. have created uicellview in xib file , on have button want move on addlocationvc viewcontroller when pressed button.

i have written code

uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil];  addlocationvc *view = [storyboard instantiateviewcontrollerwithidentifier:@"addlocation"]; 

its not worked when pressed button not redirect me on view controller addlocationvc controller coming in section of code.

the efficient way of doing use protocols or blocks. delegate protocol steps be:

  1. define delegateprotocol in custom cell class
  2. in cellforitem/rowatindexpath: make viewcontroller delegate of cell , implement protocol in it. here you'll instantiate new viewcontroller , present/push it
  3. on button tap call delegate method

Comments

Popular posts from this blog

php - Autoloader issue not returning Class -

python - Getting next two indexes regardless of current index -

ruby - Prevent Custom Validation Error on Association -