iphone - Dismiss UIPopoverController on didSelectRowAtIndexPath -


i have implemented uipopovercontroller storyboard not able make dismiss when select particular row in uitableview.enter image description here

when select particular row time want dismiss popover not able dismiss it.

i write below code this:

//show popover in main uiviewcontroller

-(ibaction)clicknotes:(id)sender {      nslog(@"notes:");        notelist *objnotelist = [[notelist alloc] initwithnibname:@"notelist" bundle:nil];     popover.delegate = self;     popover = [[uipopovercontroller alloc] initwithcontentviewcontroller:objnotelist];     popover.popovercontentsize = cgsizemake(250, 450);     [popover presentpopoverfromrect:cgrectmake(730, 0, 1,1) inview:self.view     permittedarrowdirections:uipopoverarrowdirectionup animated:yes];      } 

//hide popover in uiviewcontroller on didselecterowatindexpath

   - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath   *)indexpath    {        notepad_ipad *objnote = [[notepad_ipad alloc] init];          nsstring *mselectednotetext = @"selected text";     [objnote selectednote:mselectednotetext];    [objnote.popover dismisspopoveranimated:yes];    } 

use

 [popover dismisspopoveranimated:yes]; 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -