我想在地图中显示注释.我有字符串格式的lat和longi.现在我只需将其转换为int.
NSString *s= @"18.65799";
location1.latitude =[s intValue];
NSLog(@"1%d",[s intValue]);
NSString *s1= @"73.774262";
location1.longitude=[s1 intValue];
Run Code Online (Sandbox Code Playgroud)
但是当我显示[s intValue]时,输出为118. NSLog的输出(@"1%@",location1.latitude)为空;
请帮忙.
更改:
NSLog(@"1%d",[s intValue]);
Run Code Online (Sandbox Code Playgroud)
至:
NSLog(@"%d", [s intValue]);
Run Code Online (Sandbox Code Playgroud)
同样对于s1:
NSLog(@"%d", [s1 intValue]);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8870 次 |
| 最近记录: |