开发者

string to double conversion in iphone

开发者 https://www.devze.com 2023-01-25 17:09 出处:网络
i tried assigning values like this ,where coffeshop is an object with latitude a string variable,however value of coordinates are shown 0 values,while i nslog the coffeeshop.latitude and longitude i a

i tried assigning values like this ,where coffeshop is an object with latitude a string variable,however value of coordinates are shown 0 values,while i nslog the coffeeshop.latitude and longitude i am getting correct values,is there any error in this conversion

CLLoca开发者_运维知识库tionCoordinate2D coordinate;
 coordinate.latitude=[coffeeshop.latitude doubleValue];
 coordinate.longitude=[coffeeshop.latitude doubleValue];


Hello
I sure it's a culture problem you must check your string format
I got the same error cause my String contraint coma separator instead of point. try to replace "," for "." (something like this) in the string

0

精彩评论

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