4

Is it possible to distinguish an iPhone 3G from an iPhone 3G S using any of the properties of [UIDevice currentDevice]?

Matt
  • 412
  • 7
  • 17
  • 8
    I don't know, and I wouldn't want to anyway. If you want to check for functionality, check for functionality instead of checking versions. – OregonGhost Jun 22 '09 at 09:33

3 Answers3

5

The best way to check is to use sysctlbyname("hw.machine", ...) as per How to tell if your code is running on an iPhone or an iPhone3G?

The returned result for 3GS should be "iPhone2,1"

Community
  • 1
  • 1
Stobor
  • 44,246
  • 6
  • 66
  • 69
  • Also, see http://arstechnica.com/apple/guides/2009/03/iphone-dev-determining-your-platform.ars (although you'll still have to add the 2,1 result for the 3GS). – Stobor Jun 22 '09 at 09:38
1

I don't believe so - nor even 1G phones from 3G. You have to use sysctls to get more detailed model info.

E.g. see here

frankodwyer
  • 13,948
  • 9
  • 50
  • 70
0

maybe simpler solution - try

[[[UIDevice] currentDevice] isMultitaskingSupported];

iPhone 3G has no multitasking, while 3GS and newer have.

Vilém Kurz
  • 3,401
  • 2
  • 34
  • 43