gpt4 book ai didi

iphone - 构建期间出现此错误的原因可能是什么 - 'undefined symbols for architecture i386"

转载 作者:行者123 更新时间:2023-11-28 18:02:26 25 4
gpt4 key购买 nike

这是我第一次使用定位服务,我遇到了这个链接器错误:

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];

enter image description here

最佳答案

您需要将 CoreLocation 框架添加到您的项目中。

关于iphone - 构建期间出现此错误的原因可能是什么 - 'undefined symbols for architecture i386",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6987685/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com