Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLLocationDegrees with an expression of incompatible type 'double'

Tags:

ios

cllocation

The topic says everything. why i get this error message at this 2 lines?

NSArray *coordinates = [locationDetails[@"coordinates"] componentsSeparatedByString:@","];
CLLocationDegrees *lat = [coordinates[1] doubleValue]; //here is the red arrow <----

and exactly this message will appear:

Initializing 'CLLocationDegrees *'(aka 'double *') with an expression of incompatible type 'double'

like image 247
CTSchmidt Avatar asked Jan 14 '23 17:01

CTSchmidt


1 Answers

Change this:

CLLocationDegrees *lat = [coordinates[1] doubleValue];

to:

CLLocationDegrees lat = [coordinates[1] doubleValue];

Get rid of the asterisk. CLLocationDegrees is not a class, it is a typedef for double (a basic type).

like image 161
rmaddy Avatar answered Jan 19 '23 12:01

rmaddy