-1
我有这样的方法,以便:Objective-C的参数“双*”
-(void)insertTracking:(NSString *)tag deviceId:(NSString *)phone latitude:(double *)latitudeId longitude:(double *)longitudeId Completetion:(void (^) (NSArray * result,NSError * error))completion{
}
,给了我这样的警告:
Format specifies type 'double' but the argument has type 'double *'
,这是怎么了调用它:
[self insertTracking:barcodeHolder deviceId:[[UIDevice currentDevice] name] latitude:currentLocation.coordinate.latitude longitude:currentLocation.coordinate.longitude Completetion:^(NSArray *results, NSError *error){
}];
,我得到这个错误
Sending 'CLLocationDegrees' (aka 'double') to parameter of incompatible type 'double *'
变量的经度和纬度来自CLLocation如何将它们传递给double?当我将它们作为字符串插入时,它们会插入到我的数据库中,因为0请帮助,我不明白我做错了什么。
'insertTracking:deviceId:等等:'你自己的方法?你的主要问题是这个方法期望一个'double *'并且你给它一个'double'(注意“*”的存在/不存在)。 – Larme
从您的方法中删除*。 – ErasmoOliveira