Saturday, 18 February 2012

Oh, I didn't know that there are 2 iPhone simulators in Xcode?

I think most of you might already know this. It's a bit embarrassing, but I have to admit that I just found out about this a few days ago by accident...

If you have been following my blog you might have noticed all my screen dumps were like the one below, using the iPhone simulator in Xcode - which surely looks like a nice iPhone 4 device.

I then found that by clicking on the "Hardware -> Device" option in "iOS simulator", as shown below, there's a "iPhone (Retina)" one which I never seen before... Now, where did that come from??!!

And then it switched to an ugly, rectangular shape, urh........... "box"? What, you call that an iPhone with Retina display? Are you sure this is made by Apple? This looks more like the iPad simulator to be honest, but the header says "iPhone (Retina)"...
If you look at the log below, the "screenBound.size" is still 480x320 which is the same as above. But "screenScale" is now 2.0 instead of the 1.0 shown in previous screen... So may be this ugly thing is indeed the iPhone simulator with Retina display.... Now we have one extra "device" to test on for all future projects....damn...

And probably because the "screenScale" remains the same, when I use the following methods to fill the background colour using same pattern (but with another transparent view to slightly change the colour), as shown far below, it looks the same on both.

    [UIColor colorWithPatternImage: [UIImage imageNamed:imageFileName]]

Recently, we have all seen lots of "rumours" about Apple going to release iPad 3 with Retina display sometime in the next few months. I would surely check to see if there's going to be a new "iPad (Retina)" option when the next version of Xcode been released (mine currently 4.2)...

[Update 09/03/2012] see this post for info about the iPad retina (iPad 3) simulator in new Xcode 4.3.1

No comments:

Post a Comment