這是我第一次與位置服務工作,我打這個連接錯誤:可能是什麼建立在這個錯誤的原因 - 「爲i386" 硬件架構未定義的符號
Undefined symbols for architecture i386: "_OBJC_CLASS_$_CLLocationManager"
我已經加入#import <CoreLocation/CoreLocation.h>
,並添加以下行的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];
您可能想要編輯問題標題以便更具描述性。 –
是的! – Legolas
可能的重複[如何解決未定義的符號錯誤?](http://stackoverflow.com/questions/804510/how-to-resolve-undefined-symbols-error) –