CGFloat Incompatible types upon initialization

Does anyone see a problem here?

double latDouble = [latString doubleValue];
double lngDouble = [lngString doubleValue];

CGFloat dist = [self calcDiffDistance:latDouble withPostLng:lngDouble]; // Incompatible types in initialization

- (float)calcDiffDistance:(double)postLat withPostLng:(double)lon1
{
    ...
}
+3
source share
1 answer

typedeffor CGFloat- doublein a 64-bit system and floatin a 32-bit system. I assume that you are compiling into a 64-bit system and assigning the return value to a floatvariable double.

+4
source

Source: https://habr.com/ru/post/1796600/


All Articles