Neznajka
Neznajka

Reputation: 305

Photo Library on iOS Simulator

I have xcode 4.5.2 and work with iOS 6. I need create photo library, and i must keep photo and show my app with only simulator. And i can't find directory where i can paste my photos (like photo library on iPhone) for further browse this photo to my app. Or how browse photos to app Photo in iOS Simulator. I saw some links like

Users/Library/Application Support/iPhone Simulator/5.0/Media/DCIM 

but i have not such directory =(

So if i will use

UIImagePickerControllerSourceTypePhotoLibrary

where i must find photos, if i use only iOS Simulator without any apple devices?

Upvotes: 3

Views: 1749

Answers (2)

Mohammad Rabi
Mohammad Rabi

Reputation: 1412

You may need to create DCIM if it doesn't already exist.

You can add photos from safari in the simulator, by Tapping and Holding on the image. If you drag an image (or any other file, like a PDF) to the simulator, it will immediately open Safari and display the image, so this is quite an easy way of getting images to it.

simple steps :

1) Drag & Drop image onto simulator - this will open a browser with your image

2) Click & hold image - this will open options

3) save image - this will copy image onto simulator

Upvotes: 4

Adrian P
Adrian P

Reputation: 6529

here is how you add an image to the photos in your xcode simulator. start the simulator by selecting your app and run it. then stop the run operation in xcode so you can go to the home screen in your simulator. drag and drop an image into your simulator screen. depending to what version of the xcode you are using it will differ how you save the image. i use Xcode 4.5. in 4.5 when you drop the image it opens a web view like window. on the butom of the screen you can tap the middle icon and it gives you the option and icons for sharing. just save the image to photos in there and there you have it. hope this helps.

Upvotes: 0

Related Questions