0

It's the first time I am working with the location services and I am hitting this linker error:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_CLLocationManager"

I had added #import <CoreLocation/CoreLocation.h> and added the following lines in the viewDidLoad

 CLLocationManager *manager = [[CLLocationManager alloc] init];
manager.delegate = self;
[manager startUpdatingLocation];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

if (![CLLocationManager locationServicesEnabled]){
    UIAlertView *servicesDisabledAlert = [[UIAlertView alloc] initWithTitle:@"Location Services Disabled" message:@"You currently have all location services for this device disabled. If you proceed, you will be asked to confirm whether location services should be reenabled." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [servicesDisabledAlert show];
    [servicesDisabledAlert release];
}
[manager release];                

enter image description here

Filip Radelic
  • 26,607
  • 8
  • 71
  • 97
Legolas
  • 12,145
  • 12
  • 79
  • 132

3 Answers3

8

You need to add CoreLocation framework to your project.

Filip Radelic
  • 26,607
  • 8
  • 71
  • 97
1

Make sure the Core Location framework is linked to your project before building.

Perception
  • 79,279
  • 19
  • 185
  • 195
1

Did you remember to add the framework to your project under the build phases? Here... How to "add existing frameworks" in Xcode 4?

Community
  • 1
  • 1
mjisrawi
  • 7,846
  • 3
  • 24
  • 27