FAQ Database Discussion Community


iOS Crash: Terminating app due to uncaught exception reason: UIPopoverPresentationController should have a non-nil sourceView

ios,objective-c,crash,uipopovercontroller
I need help figuring this crash out. I checked stackoverflow for answers, but non of the answers relates to my situation. This is my code. - (void)addImagesActionSheetClickedButtonAtIndex:(NSInteger)buttonIndex { // Cancel if (buttonIndex == 2) return; //Take picture if (buttonIndex == 0) { //Take picture isFromLibrary = NO; [self.imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; [self.navigationController...

Trying to dismiss a popover view controller with a table view inside of it

ios,objective-c,uipopovercontroller
I'm trying to dismiss a popover when selecting a cell inside of it. I have created a custom delegate to support this however it is not working: In my class that houses the PopOver and table View I have the following: In .h: @protocol DismissDelegate <NSObject> -(void)didTap; @end @interface AssistanceNeededAtPopOverViewController...

UITabBarController and UIPopover Screen Flashes White

ios,ipad,uitabbarcontroller,uipopovercontroller
I'm running into a unique bug: I have a UITabBarViewController that I have presented with presentViewController:animated:completion: (I'm presenting it fullscreen in this way, because the presenting view controller only permits landscape orientations, while the presented tab bar vc permits all orientations. So when you dismiss the presented tab bar vc...

UIPopoverController displays at wrong position

autolayout,uipopovercontroller
I want to show a UIPopoverController when clicking on a label. All elements are laid out with AutoLayout. // In TorHeimPopoverViewController.swift // self.view is TorHeimPopoverViewController's view popover.presentPopoverFromRect(label.frame, inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Left, animated: true) It's displayed in another UIPopoverController (TorHeimPopoverViewController) and there in a Container MainAppView -> TorHeimPopoverViewController -> ContainerView How...

calling dismissPopoverAnimated in viewWillDisappear crashes application

ios,objective-c,uiviewcontroller,uipopovercontroller
I have two ViewControllers. Let's call them no1 and no2. In no2 I have PopoverViewController with some options and instance of NSTimer. Timer function is calling popToViewController 3 seconds after popup is presented if nothing is clicked in the popover, which is returning user to no1 ViewController. Problem is when...

UIPopViewController not working

ios,objective-c,xib,uipopovercontroller
I have an xib file with a .h and .m linked. In the xib there is a UIView with a textView. What I would like to do with that view is open it as a UIPopViewController when you click a button. Here is my code: - (IBAction)thisButton:(id)sender { popViewController *popVC...

How do I create a bouncing popover animation like this?

ios,objective-c,uipopovercontroller
I want to create an animated popover bubble like the one below. With the same expanding/contracting bounce animation. Does anyone know how to go about this? Is is just a UIView with animation? What animation effect is this? Any pointers on how to go about this would be really appreciated....

Dismiss Popover after touch

swift,ios8,uipopovercontroller
I've created a popover inside my MainViewController when some button its touched using the UIPopoverPresentationController and set like it's delegate like it's showed in the WWDC 2014, in the following way : MainViewController.swift class MainViewController : UIViewController, UIPopoverPresentationControllerDelegate { @IBAction func showPopover(sender: AnyObject) { var popoverContent = self.storyboard?.instantiateViewControllerWithIdentifier("PopOverViewController") as UIViewController...

Popover controller got destroyed (nil) in iOS 8

ios,objective-c,uipopovercontroller
In iOS 7 I used to define weak reference to popover controller inside my view controller (which displays in popover). I used this reference to popover controller in order to dismiss popover programmatically. Also, I defined delegate of popover controller in order to track dismissing events (popoverControllerShouldDismissPopover etc). In iOS...

Swift, This class is not key value coding-compliant for the key “array”

swift,uipopovercontroller,popover
I am developing popover controller and while opening the popover I am transferring the Array (properties) to the popoverController (SortingPopoverController).For view I have s created popView.xib and in firstOwner, I have attached the "SortingPopovercontroller". My code below func sortingPressed(sender: AnyObject){ var sortingPopView = SortingPopoverController(nibName: "PopView",bundle: nil ) var sortingPopoverController =...

UIPopoverController arrow not the same white as my UINavigationBar

ios,objective-c,xcode6,uipopovercontroller
So the problem that I have is my UIPopoverController's arrow is a different color to my UINavigationBar color. If you look at the image there is a slight shadow on the white and you can see it is not the same white: This only happens on iOS 8 and not...

Popover doesn't center on button

ios,swift,uipopovercontroller
I am trying to center a popover on a button. I can't seem to figure out where I might be going wrong. Instead of the arrow being in the middle of the button, it is off center by half the width of the screen. @IBAction func buttonClicked(sender: AnyObject){ var popoverViewController...

What if you cant invoke [super init] first

ios,objective-c,uipopovercontroller
I'm trying to subclass UIPopoverController and give IT the proper responsibility of determining what kind of UIViewController (contentViewController) to create and present rather than horribly cluttering the popover's calling code with that responsibility. But I'm running into several issues. According to Apple documentation, there is never a valid reason to...

How to display a popover when user touches and holds a segment in segmented control (iOS)

ios,uipopovercontroller,uisegmentedcontrol
I need to display a popover with additional options when a user touches (and holds) a segment in UISegmentedControl. How do I: detect the hold "gesture" on the segmented control. Display the popover with additional options on top of the selected segment Thanks! note a related question is:iPad popover -...

UIActivity activityViewController crash on iPad in Swift

ios,ipad,swift,uipopovercontroller,uiactivityviewcontroller
I have the following code below to toggle UIActivityViewController @IBAction func shareButtonClicked(sender: UIButton) { let textToShare = "Text" if let myWebsite = NSURL(string: "http://www.example.com/") { let objectsToShare = [textToShare, myWebsite] let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil) self.presentViewController(activityVC, animated: true, completion: nil) } } But it crashes on iPad. How...

How to fill data in UItableview in popover from UIViewcontroller?

ios,uitableview,swift,uipopovercontroller
I think this is an easy question. I've looked at other solutions but they to miss a key step for me. IOS: fill a popover with a tableview How to shove an array of values into an empty table in a popup? The data is loaded properly and returned in...

get index path for editing row in prepareForSegue?

ios,xcode,uipopovercontroller
I am presenting a popover from a UITableView and using the prepareForSegue method as discussed in In WWDC 2014 "View Controller Advancements in iOS8" - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { UINavigationController * nvc = segue.destinationViewController; UIPopoverPresentationController * pvc = nvc.popoverPresentationController; pvc.delegate = self; } - (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller { return UIModalPresentationNone; }...