ios - Dismiss navigation controller and all of its view controllers stack in UIPopupview using a button within one of the views -


i displaying uipopoverview using code:

selectclientpopcontroller= [[uipopovercontroller alloc]initwithcontentviewcontroller: [self.storyboard instantiateviewcontrollerwithidentifier:@"navcontrollermini"]]; selectclientpopcontroller.popovercontentsize=cgsizemake(500, 700); selectclientpopcontroller.delegate=self; [selectclientpopcontroller presentpopoverfromrect:cgrectmake(cell.frame.origin.x+120-scrollview.contentoffset.x, cell.frame.origin.y+120,cell.frame.size.width, cell.frame.size.height) inview:self.view permittedarrowdirections:uipopoverarrowdirectionleft | uipopoverarrowdirectionright animated:yes]; 

this navigation view controller ued step through 2 tableviewcontrollers shown below:

storyboardimage

when cell on last tableview pressed, dismiss whole popover. understand needs done using delegates, not know assign delegates in order achieve this. help.

why not

 // listen tableview row selection setting delegate.   // self if set delegate in same view controller  yourtableview.delegate = yourviewcontrollerobjectwhichhastableview;   - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{      [selectclientpopcontroller dismisspopoveranimated:yes];  } 

whenever u need dismiss popover use above method. refer apple's documentation


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -