4

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'

Falko
  • 17,076
  • 13
  • 60
  • 105
CTSchmidt
  • 1,155
  • 3
  • 17
  • 30

1 Answers1

9

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).

rmaddy
  • 314,917
  • 42
  • 532
  • 579