Unable to see images in Camera roll in iPad Simulator when run at iPhone resolution

穿精又带淫゛_ 提交于 2019-12-23 02:34:16

问题


I made an image editing app for iPhone, and it got rejected because the app is not able to run on ipad at iphone resolution. It failed in both 1x and 2x resolution.

When I click choose photo, I present the camera picker to select a pic, but camera picker is not showing any images in the simulator.(I didnt test this in real device, I beleive apple will test this in real device) It works normally in iPhone, and also in iPad if I make the app Universal.

But If I make the app compatible for iPhone, then it should also run in iPad at iPhone resolution, which is not happening in my case!!!

Here are the screenshots of ipad pro simulator:

After I choose the pic, it should display in the imageview, but I get the blank imageview without image.

I dont have anything fancy in code. It is a routine camera picker:

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:picker animated:YES completion:NULL];
  • I did try to put a breakpoint while picker is presented and after the image is selected. The picker and the selected image is not nil, but when I preview the selected image on xcode, it shows a blank image:

  • Surprisingly, when I run the app in iphone simulator xcode showed the image:

NOTE:

  • When run the app on iphone simulator for the first time, camera picker asked permission to access the photos.But When I run it on iPad at iPhone resolution, picker didnt asked for any permission!!!!

来源:https://stackoverflow.com/questions/33942311/unable-to-see-images-in-camera-roll-in-ipad-simulator-when-run-at-iphone-resolut

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!