I see two problems.
You are doing this too early.
viewDidLoad
means your view is not yet in the window. It just means that the view exists. Wait untilviewWillAppear:
orviewDidAppear:
to do this. That is the sign that the view is now in the interface. You might have to use a condition so as to do it only the first time.This code is really weird:
if(self.view.window!=nil) [objPopView presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
You have not yet defined
objPopView
, plus if this condition is met you will do this presentation of the popover and then go right on and do another presentation of the popover.