Photo Library on iOS Simulator - objective-c

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?

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

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.

Related

Is it possible to download my app preview images from iTunesConnect?

I created an app, that supports all the resolutions of apple devices. As a result, I have app preview images in the following resolutions:
iphone 6 plus
iphone 6
iphone 5
iphone 4 and below aspect ratio
ipad
The problem is, I deleted the images from my hard drive, and need the exact same images as I am adding app store descriptions in new languages. It would be very tedious to create the images again. Is there a way I can download the images I uploaded in their original resolution ?
EDIT: If I log into itunesconnect and try to right click on the images and copy / download, the images downloaded are of much lower resolution. Any suggestions ?
You can copy/download an app preview image with the same resolution as you added it. Click on the image in iTunesConnect and then you will see your image with original resolution in full screen mode.

Images.xcassets not working for specific devices in universal application Xcode 5, iOS 7

I'm updating iOS 6 universal application (for both - iPhone and iPad) to iOS 7 and I want to use Images.xcassets to store images in it.
For universal images (like some buttons which are the same on iPhone and iPad) this storage is working properly. But for the device specific images it is not working and I'm getting following errors on iPhone simulator:
CUICatalog: Can't find rendition for name: search_next scale factor: 2 device idiom: 1 device subtype: 568
Could not load the "search_next" image referenced from a nib in the bundle with identifier "sk.company.app"
But the image is there:
When I add universal image to this asset, it is working:
I tried this same in blank application and it's working perfectly fine, so I think it's something wrong with options, but I can't figure out where.
I more hint: the first scenario (only specific images in asset) is working, when I switch universal app to iPhone only app in project settings.
For Universal Application always use naming convention recommended by Apple. For example you have a button image, place images for both iPhone and iPad e.g.
Button~iphone.png
Button#2x~iphone.png
and For iPad
Button~ipad.png
Button#2x~ipad.png
When you will do that you will not get error "CUICatalog: Can't find rendition for name:" Thanks :)
Looks like it had something to do with CocoaPods. After update, everything works fine.
The solution is given in the error message:
"Could not load the 'search_next' image referenced from a nib
in the bundle …"
If you look at your screenshot, you'll see that the image is named "search_next#2x -2 .png", where it should be named "search_next#2x.png". The "-2" has probably been added when you dragged another image somewhere, while the #2x version was already present.
If you solved it by updating CocoaPods it was an issue of a library, but the solution has really nothing to do with CocoaPods.

Is there a different way to view the iOS Simulator in Xcode 5 / Am I viewing my button correctly?

So I'm doing the Ray Wenderlich tutorials on iOS, and I'm doing the button tutorial. When I run the app, I get something that looks like this:
I have two questions:
I often see simulators show up in the form of an actual iPhone and was wondering if that was possible, or if that rectangle is the only way to view it?
The reason I'm asking is when I connected the button to an action (It says 'Pressed!'). So, is it supposed to show up in the box (bottom right) only, or should it should up on the simulator itself- mimicking what the user would see on-screen?
Regarding your first question: Probably a problem with screen size. See also here How can I restore the iPad frame around iOS Simulator 5.1?
The output seen in the screenshot is produced with NSLog and won't be seen on the device. You need to add an UILabel or such and set its text.
In the Simulator menu, try selecting Window then Scale and go to 50%. The retina models are far too big on my screen. Also, the old iOS 6 simulator with standard iPhone did look like a real phone, so examples from a while ago will look different.
If you want to support iOS 6.x, you can load it into Xcode. From Xcode main menu, select Xcode and then Preferences, and go to the Downloads tab.

AppIcon overlays with launch image

I create a new iOS project in XCode 5. I choose to use asset catalog for both app icons & launch images. When I run the application, the app icon is overlayed on the launch image. How do I prevent this?
This is my app icon:
This is launch image:
I get this as the launch image on the simulator (and in device)
For those who come here searching, I solved this issue. The launch images should be opaque and not transparent.
I used iDraw to create the launch image. Instead of exporting the entire canvas, I selected 'all objects' which created a transparent image, which caused this issue.
Now it is solved and submitted to AppStore

screen resolution dependent image source

I am developing a Windows 8 metro (yeah!) app. How do i provide a screen resolution dependent image source ?
As per these guidelines, we can achieve it using image naming convention too.
I have an image control as show below.
<Image Source="Assets/test.jpeg"/>
I also have test.scale-100.jpg, test.scale-140.jpg & test.scale-180.jpg images in asset folder. Each image having different icon color to identify which image is loaded.
If i run the app in simulator and change screen resolutions, i still see test.scale-100.jpg for any resolution. Why is this happening ? In which case will the OS load test.scale-140.jpg or test.scale-180.jpg image ?
EDIT: I got it working. Once your app starts in simulator, close it by pressing home buton & uninstall it. In VS, right click on Project and click on Deploy. App should be now deployed to simulator. Change the resolution and start the app. You should now see correct image loaded by OS. Rinse and repeat to test other resolutions.
The scaling is automatic. If your images are correctly named, and you change resolution in the simulator you must restart the app to see scaled images. It doesn't happen on the fly, IIRC.
Finally got it working. close the app and uninstall it from
simulator.
In VS, right click the project and click deploy.
Change to desired screen resolution and start the app. OS should not pick proper image as per resolution.
Rinse and repeat same to test images on various resolutions.