-1

I have property of type CLLocationCoordinate2D, how can I use forward declaration to declare that?

 @class CLLocationCoordinate2D;

do not works

rmaddy
  • 298,130
  • 40
  • 468
  • 517

1 Answers1

0

What you are looking for here is not forward declaration at all. You want to make use of the struct CLLocationCoordinate2D. First off that is not a class - for forward declaring structs look here.

BUT in your case you do not even have to use forward declaration since you only need to / have to include the correct header in your project. Namely CoreLocation:

@import CoreLocation;

or a little bit old fashioned

#import <CoreLocation/CoreLocation.h>

Additionally you probably have to add the CoreLocation framework as well if you have not done that already.

Community
  • 1
  • 1
luk2302
  • 46,204
  • 19
  • 86
  • 119