Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何将std代码设置为电话号码的前缀?_Ios_Iphone_Xcode - Fatal编程技术网

Ios 如何将std代码设置为电话号码的前缀?

Ios 如何将std代码设置为电话号码的前缀?,ios,iphone,xcode,Ios,Iphone,Xcode,我是iOS新手。在我的应用程序中,我需要添加电话号码。我在我的个人资料中添加电话号码,例如1234567890,当我在显示页面上时,它会显示相同的1234567890,但我希望它带有std代码作为前缀,例如(印度)+911234567890 有人能帮我吗。 谢谢。如果您的应用程序仅在印度使用或仅在印度使用 NSString *stdCode = @"+91"; NSString *phoneNumber = @"1234567890"; NSString *resultStr = [NSStri

我是iOS新手。在我的应用程序中,我需要添加电话号码。我在我的个人资料
中添加电话号码,例如1234567890
,当我在显示页面上时,它会显示相同的1234567890,但我希望它带有std代码作为前缀
,例如(印度)+911234567890

有人能帮我吗。
谢谢。

如果您的应用程序仅在印度使用或仅在印度使用
NSString *stdCode = @"+91";
NSString *phoneNumber = @"1234567890";
NSString *resultStr = [NSString stringWithFormat:@"%@%@", stdCode, phoneNumber];