How to tell if your code is running on an iPhone or an iPhone3G?

前端 未结 3 378
醉梦人生
醉梦人生 2020-12-05 07:35

I am trying to determine if my code is running on an iPhone or an iPhone3G. My first try was to use the UIDevice class in UIKit, but both iPhone and iPhone3G return the sam

3条回答
  •  生来不讨喜
    2020-12-05 08:01

    I'm not an iPhone developer but checking for the underlying platform instead of platform capabilities is almost always the wrong choice. If the iPhone gains the functionality you need, you will still fail to run. There's also a chance you'll make the wrong decision on the next iPhone 4.0 (or whatever it is called).

提交回复
热议问题