Pretty much I want to properly have the size of a button in my app converted to the amount of pixels for its width and height.
So lets say it has a width of 50 and a height of 100, on a retina display device I want it to return a width of 100 and a height of 200. On a non-retina device it should return a width of 50 and a height of 100.
And it should work the same way on the iPad. Anyway, how would I do this? Would I use the UIScreen's mainScreen scale, or is there another way?
Thanks!
Everything you put on the screen in measured in points, not pixels. A non-retina iPhone is 320x480 points. A retina-iPhone (3.5") is 320x480 points.
This is true on all devices. Don't worry about pixels, worry about points.
Your button would be measured as 100x50 on all devices.
Update:
When working with images you need to create two sets of images.
By providing the two images, the OS grabs the proper one. Your code still measures everything in points. So the 200x100 retina image will be shown as 100x50 points on a retina device.