add photos to iPhone simulator

我们两清 提交于 2019-12-07 00:55:45

问题


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. ~/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];
  }

I tried also UIImagePickerControllerSourceTypePhotoAlbum and still no photos in album.

AI solved it in such a way:

  • 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.

What it can be? Thanx.


回答1:


AI solved it in such a way:

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.



来源:https://stackoverflow.com/questions/4223848/add-photos-to-iphone-simulator

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