开发者

Detect iphone region

开发者 https://www.devze.com 2022-12-26 11:25 出处:网络
In my app, the user is supposed to insert a phone number, which is then displayed somewhere else. In the contacts application, when displaying a phone number, it automatically appears in the format o

In my app, the user is supposed to insert a phone number, which is then displayed somewhere else.

In the contacts application, when displaying a phone number, it automatically appears in the format of the language selected by the user.

Is there a way to do this automatically, or a way to detect the region and then 开发者_C百科adapt the displayed string?


You can use NSLocale for getting that type of information.

[NSLocale currentLocale];

Check the documentation for further information: http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSLocale_Class/Reference/Reference.html

0

精彩评论

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