开发者

CGFloat Incompatible types in initialization

开发者 https://www.devze.com 2023-02-14 22:02 出处:网络
Anyone see the issue here? double lat开发者_如何学CDouble = [latString doubleValue]; double lngDouble = [lngString doubleValue];

Anyone see the issue here?

double lat开发者_如何学CDouble = [latString doubleValue];
double lngDouble = [lngString doubleValue];

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

- (float)calcDiffDistance:(double)postLat withPostLng:(double)lon1
{
    ...
}


The typedef for CGFloat is double on a 64-bit system, and float on a 32-bit system. My guess is you're compiling on a 64-bit system, and are assigning a float return value to a double variable.

0

精彩评论

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