Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 我正在尝试使用UIPopoverContoller加载图像_Ios_Uipopovercontroller - Fatal编程技术网

Ios 我正在尝试使用UIPopoverContoller加载图像

Ios 我正在尝试使用UIPopoverContoller加载图像,ios,uipopovercontroller,Ios,Uipopovercontroller,我在xcode 4.2中制作了一个简单的通用图像加载器,它允许您从手机库中选择一张照片并将其显示在屏幕上。这是一款通用应用程序,使用UIImagePickerController可以打开菜单并选择照片,但当用户单击ipad上应显示popoverController按钮的按钮时,会返回一个错误 #import "ImageLoaderViewController.h" @implementation ImageLoaderViewController @synthesize imageView

我在xcode 4.2中制作了一个简单的通用图像加载器,它允许您从手机库中选择一张照片并将其显示在屏幕上。这是一款通用应用程序,使用UIImagePickerController可以打开菜单并选择照片,但当用户单击ipad上应显示popoverController按钮的按钮时,会返回一个错误

#import "ImageLoaderViewController.h"

@implementation ImageLoaderViewController
@synthesize imageView = _imageView;
@synthesize popoverController;

-(void)selectPhoto
{
    NSLog(@"YYOYOYOYOY");

    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
    NSLog(@"now i am here");
    imagePicker.delegate = self;

    if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        NSLog(@"camera");
        imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    }
    else{
        NSLog(@"NO camera");
        imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;}
    if(IS_IPHONE)
    {
        NSLog(@"is an iphone");
        [self presentModalViewController:imagePicker animated:YES];
    }

    else
    {
        if ([popoverController isPopoverVisible])
            [popoverController dismissPopoverAnimated:NO];
        popoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
        popoverController.delegate = self;
        [popoverController presentPopoverFromBarButtonItem:self.navigationItem.rightBarButtonItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

    }

}

-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    _imageView.image = [info objectForKey:UIImagePickerControllerOriginalImage];
    if(IS_IPHONE)
        [self dismissModalViewControllerAnimated:NO];
}

-(void) popoverControllerDidDismissPopover:(UIPopoverController *)popoverController
{
    [popoverController dismissPopoverAnimated:NO];
}



@end

它没有说错误,或者如果是这样,我不知道如何检查,但断点是我展示popoverController的地方。