1

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

Mishal Awan
  • 724
  • 2
  • 11
  • 25

1 Answers1

3

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."

Phillip Mills
  • 30,888
  • 4
  • 42
  • 57
  • means i want to select a value from popover and store in text box ??? which another control i may use ? – Mishal Awan Nov 11 '14 at 13:06
  • You can push or present another view controller, depending on your app logic. You could have a hidden text field that gets displayed when the button is pressed if there's space for it.... – Phillip Mills Nov 11 '14 at 13:09
  • ahan i waz thinking on button click i will show a popover through in which diffrent colours are present and selecting one colour it will set in text box.. which control will i use ??? – Mishal Awan Nov 11 '14 at 13:12