我有一个问题,我不知道如何解决它。
我的代码如下所示
CLLocationCoordinate2D coord[12];
coord[0] = CLLocationCoordinate2DMake(52.5041,13.351);上面写着:
类型说明符缺失,默认为“int”
我不明白为什么。我尝试了不同的想法,甚至在这个页面上看到了类似的代码,当时我正在寻找一个提示。
Gz禤浩焯
发布于 2014-05-21 13:04:33
根据文件:
CLLocationCoordinate2D CLLocationCoordinate2DMake(CLLocationDegrees latitude, CLLocationDegrees longitude)和
typedef double CLLocationDegrees;在编写CLLocationCoordinate2DMake(52.5041,13.351);时,52.5041和13.351可能不被认为是双重的。
就像这样:
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc]init];
[numberFormatter setNumberStyle:kCFNumberFormatterDecimalStyle];
NSNumber *lat = [numberFormatter numberFromString:@"52.5041"];
NSNumber *lng = [numberFormatter numberFromString:@"13.351"];
coord[0] = CLLocationCoordinate2DMake(lat,lng);https://stackoverflow.com/questions/23783771
复制相似问题