如何将NSMutableArray值转换为NSString? [英] how to converts NSMutableArray values into NSString?
本文介绍了如何将NSMutableArray值转换为NSString?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所有如何将 NSMutableArray
值转换为 NSString
当我这样做时
hi all how to convert NSMutableArray
values into the NSString
when i did as like
Webservices *details=[[Webservices alloc] init];
[details getMobileNumberDetails:phnotextfield.text];
NSLog(@"longitudes Arrays from %@",details.resultData);
- 91.57696007,
10.343234,
74.982343,
76.464844,
76.464844,
2.256,
"-91.57696007", "10.343234", "74.982343", "76.464844", "76.464844", "2.256",
但是当这样实现时
theCoordinate2.longitude = [[details.longarray objectAtIndex:0] floatValue];
NSLog(@"longitudes list from %@",theCoordinate2.longitude);
-91.57696007
-91.57696007
但我的目的是将所有值分配给 theCoordinate2.longitude
所以请帮我存储到iphone中的string元素。
but my intention is to assign all values to theCoordinate2.longitude
so help me to store into string element in iphone.
推荐答案
您可以使用以下代码:
theCoordinate2.longitude = [[details.longarray objectAtIndex:0] stringByAppendingString:[details.longarray objectAtIndex:1];
//and so on for index 2,3,4 stringByAppendingString:[details.longarray objectAtIndex:2
NSLog(@"longitudes list from %f",theCoordinate2.longitude);
这篇关于如何将NSMutableArray值转换为NSString?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文