Moshe
Moshe

Reputation: 58107

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 device interface?

Upvotes: 1

Views: 4058

Answers (1)

Noah Witherspoon
Noah Witherspoon

Reputation: 57149

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.

Upvotes: 2

Related Questions