It is my first app that I am trying to build in Iphone and I have some problems. Although I have read similar threads here I was not able to find the answer.I want to show popoverview controller on my button click.but unable to do. i am getting exception mention in question title above below are my files .h file

@property (nonatomic,strong) UIPopoverController *popOver;
@property (nonatomic,strong) SecondViewController *popOverView;

.m file

- (IBAction)Getcompany:(id)sender {
    SecondViewController *popoverview=[self.storyboard instantiateViewControllerWithIdentifier:@"popover"];
    self.popOver =[[UIPopoverController alloc] initWithContentViewController:popoverview];// getting exception in this line
    popOver.delegate=self;
    [popOver presentPopoverFromRect:[sender frame] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];





}

thanx in advance

1

There are 1 best solutions below

3
On BEST ANSWER

It is not available on an iPhone. From the documentation: "Popover controllers are for use exclusively on iPad devices. Attempting to create one on other devices results in an exception."