开发者

Getting device info in iOS?

开发者 https://www.devze.com 2023-01-09 07:35 出处:网络
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.

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

精彩评论

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