开发者

Getting device info in iOS?

I'd like to find out and store information about a users device.

I'm looking for the date, the type (iPhone/iPod/iPad), the locale (Language) and location.

The date should be simple to get, as is the device type.

What code is used to find out the current locale/language of the d开发者_StackOverflowevice interface?


Check out the NSLocale class. You can grab an instance of the current locale using +currentLocale or +autoupdatingCurrentLocale; the class defines a number of constants that you can use to get language and country information from that instance using its -objectForKey: method, e.g. NSLocaleCountryCode and NSLocaleLanguageCode.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜