主题说明了一切.为什么我在这2行收到此错误消息?
NSArray *coordinates = [locationDetails[@"coordinates"] componentsSeparatedByString:@","];
CLLocationDegrees *lat = [coordinates[1] doubleValue]; //here is the red arrow <----
Run Code Online (Sandbox Code Playgroud)
并且将显示以下消息:
使用不兼容类型'double'的表达式初始化'CLLocationDegrees*'(又名'double*')
改变这个:
CLLocationDegrees *lat = [coordinates[1] doubleValue];
Run Code Online (Sandbox Code Playgroud)
至:
CLLocationDegrees lat = [coordinates[1] doubleValue];
Run Code Online (Sandbox Code Playgroud)
摆脱星号.CLLocationDegrees不是类,它是double(基本类型)的typedef .
| 归档时间: |
|
| 查看次数: |
4579 次 |
| 最近记录: |