Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display a UIPopover from another class?
    text
    copied!<p>I have a iPad app (XCode 5, iOS 6, ARC and Storyboards), which has a class to display a UIView. From a separate class, I want to display a UIPopover under a certain condition.</p> <p>I'm having a problem with the last line of code:</p> <pre><code>// create a popover for login or registration UIViewController* popoverContent = [[UIViewController alloc]init]; UIView* popoverView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 280, 180)]; popoverView.backgroundColor = [UIColor lightGrayColor]; popoverContent.view = popoverView; //resize the popover view shown in the current view to the view's size popoverContent.contentSizeForViewInPopover = CGSizeMake(320, 280); // was 180 //create a popover controller popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverContent]; // if previous popoverController is still visible... dismiss it if ([popoverController isPopoverVisible]) { [popoverController dismissPopoverAnimated:YES]; } // [popoverController presentPopoverFromRect:popoverView inView:self // permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; SettingsViewController *svc = [[SettingsViewController alloc]init]; [popoverController presentPopoverFromRect: popoverView inView:svc.view.frame permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; </code></pre> <p>It's telling me: </p> <blockquote> <p>Sending 'UIView *__strong' to parameter of incompatible type 'CGRect' (aka 'struct CGRect')</p> </blockquote> <p>How do I fix this? (I've tried different ways of presenting the popover, but none of them work).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload