开发者

CGFloat Incompatible types in initialization

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜