system.getInfo("model") not returning "iPhone4"

The simulator is set to iPhone 4
I call

1
system.getInfo("model")

I had to do the same thing. I set some values early in my code to calculate a multiplier factor using the following:

local dWidth = display.viewableContentWidth
local dHeight = display.viewableContentHeight

local dWFactor = dWidth/320
local dHFactor = dHeight/480

Obviously I set my default to be the iPhone and then multiplied by the factor each time I needed a current value. It works in the simulator & I havent tried it in the real device yet. (Still playing!)

The only problem I ran into is that the values for some of the devices are fractions such as 1.6666666 for the Nexus One Height factor. I had to round down for some seamless effects using math.floor() as appropriate.

I think in the simulator it returns "iPhone4 Simulator"

@w.a.jackson thanks. that sounds like a nice workaround.

@robmiracle that's the point: it doesn't. I'm using build #704 and getInfo("model") returns "iPhone" on iPhone AND iPhone4 presets.

views:1388 update:2011/12/28 9:26:54
corona forums © 2003-2011