Solved! Solution: first I create a custom class for my scrollView and subclassed that from UIScrollView. Second I override
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
in my custom ScrollView class. in this method I called a method to dismiss the popover.
but important part is that in viewWillAppear method of the class which popover will appear, I passed self to custom scrollView class. because if I didn't that, the method for dismissing popover won't work (it needs an object of this class).
[self.scrollView initWithStoryViewController:self];
this images show in which scenario I had this problem: