将照片添加到iPhone模拟器 [英] add photos to iPhone simulator

查看:99
本文介绍了将照片添加到iPhone模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要的不是单击按钮,而是打开iPhone的默认相册,然后我可以选择一张照片.

I need than on button click opens iPhone's default album and I'll can chose a photo.

我对此有很多了解,但仍然行不通. 我执行以下操作:

I read a lot about this, but still don't works. I do the following:

  1. 〜/图书馆/应用程序支持/iPhone模拟器/用户/媒体/DCIM/100APPLE/ 我要存储两张图片IMG_0000.JPG(300像素在300像素上)和IMG_0000.THM(75像素在75px上)
  2. 在我的应用程序中,单击按钮时执行以下操作:
  1. ~/Library/Application Support/iPhone Simulator/User/Media/DCIM/100APPLE/ I'm storing two pictures IMG_0000.JPG (300 on 300 px) and IMG_0000.THM (75 on 75px)
  2. In my app I do the following on button click:

- (IBAction) btnOpenAlbum
  {
      album = [[UIImagePickerController alloc] init];
      album.delegate = self;  

      album.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

      [self presentModalViewController: album animated:YES];
  }

我还尝试了UIImagePickerControllerSourceTypePhotoAlbum,但相册中仍然没有照片.

I tried also UIImagePickerControllerSourceTypePhotoAlbum and still no photos in album.

AI通过以下方式解决了该问题:

AI solved it in such a way:

  • 打开了iPhone模拟器.
  • 拖动其中的照片.然后它会自动将其复制到〜/Library/Application Support/iPhone Simulator/4.1/Media/DCIM/100APPLE文件夹中,并将其命名为IMG_0001.PNG IMG_0002.PNG等.

之后,一切正常,但是: 当我尝试将项目直接复制到该文件夹​​并给它们指定合适的名称时,iphone无法识别它们.而且,当我从该文件夹中删除它们并运行模拟器时-照片在模拟器上的位置,但不在文件夹中.

After that all works fine, but: When I tried to copy item directly to that folder, and give them suitable names, iphone didn't recognized them. And also, when I deleted them from that folder and run simulator - photos where on simulator, but in folder they were not.

可能是什么?谢谢.

推荐答案

AI通过以下方式解决了该问题:

AI solved it in such a way:

打开了iPhone模拟器.拖到那里的照片.它将自动复制到文件夹〜/Library/Application Support/iPhone Simulator/4.1/Media/DCIM/100APPLE,并将其命名为IMG_0001.PNG IMG_0002.PNG等.之后,一切正常,但是:当我尝试将项目直接复制到该文件夹​​并为其指定合适的名称时,iphone无法识别它们.而且,当我从该文件夹中删除它们并运行模拟器时-照片在模拟器上的位置,但不在文件夹中.

Opened iPhone simulator. Drag there photos. And it automatically copy it to folder ~/Library/Application Support/iPhone Simulator/4.1/Media/DCIM/100APPLE and named them as IMG_0001.PNG IMG_0002.PNG and so on. After that all works fine, but: When I tried to copy item directly to that folder, and give them suitable names, iphone didn't recognized them. And also, when I deleted them from that folder and run simulator - photos where on simulator, but in folder they were not.

这篇关于将照片添加到iPhone模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆