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 - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -