在构建期间可能是这个错误的原因 - “未定义的架构i386的符号” [英] What could be the reason for this error during build - 'undefined symbols for architecture i386"

查看:146
本文介绍了在构建期间可能是这个错误的原因 - “未定义的架构i386的符号”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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


架构i386的未定义符号: _OBJC_CLASS _ $ _ CLLocationManager

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

推荐答案

您需要向您的项目添加CoreLocation框架。

You need to add CoreLocation framework to your project.

这篇关于在构建期间可能是这个错误的原因 - “未定义的架构i386的符号”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆