How to show Image Picker from QButtonElement?

58 views
Skip to first unread message

Quin Hulamm

unread,
Nov 4, 2013, 8:20:08 AM11/4/13
to quick...@googlegroups.com
Hi guys,

I'm trying to add a button that allows me to select an image from the photo library from a popover but I can't seem to get it to work.  The error that I get is "Popovers cannot be presented from a view which does not have a window."  From what I understand, is it because the Qdialog view is on screen?  Sorry I'm very new to objective C so my question might not make sense?  Thanks!





QButtonElement *loadImage = [[QButtonElement alloc] initWithTitle:@"Load Image" Value:@"image"];

loadImage.onSelected = ^{


        UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

        imagePicker.delegate = self;

        imagePicker.allowsEditing = YES;

        imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;

        _popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];

        [_popover presentPopoverFromRect:CGRectMake(750.0, 280.0, 1.0, 1.0)

                                  inView:self.view

                permittedArrowDirections:UIPopoverArrowDirectionRight

                                animated:YES];

};

Reply all
Reply to author
Forward
0 new messages