开发者

Detect iphone region

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜