objective-c添加/组合字符串

时间:2015-11-19 00:36:37

标签: ios objective-c

我在这里有两个字符串:

Long.text = [NSString stringWithFormat:@"%.10f", LongitudeDouble];
Lat.text = [NSString stringWithFormat:@"%.10f", LatitudeDouble];

我现在要做的是添加经度:和纬度:如何将这些作品添加到我创建的双打中。

我希望这是有道理的。

1 个答案:

答案 0 :(得分:2)

只需将所需文本添加到格式字符串:

Long.text = [NSString stringWithFormat:@"Longitude: %.10f", LongitudeDouble];

BTW - 标准命名约定规定变量和方法名称应以小写字母开头。类名以大写字母开头。