链接器命令失败,用于架构i386的未定义符号
问题描述:
我正在尝试执行半页卷曲功能。这是我使用的代码:链接器命令失败,用于架构i386的未定义符号
#import <QuartzCore/QuartzCore.h>
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:1.0f];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:(notCurled ? @"mapCurl" : @"mapUnCurl")];
[animation setRemovedOnCompletion:NO];
[animation setFillMode: @"extended"];
[animation setRemovedOnCompletion: NO];
notCurled = !notCurled;
但我遇到了以下错误
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CATransition", referenced from:
objc-class-ref in MyMapViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"_OBJC_CLASS_$_CATransition", referenced from:
objc-class-ref in SJMapViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我该如何解决呢?
答
你的应用正在抱怨它无法找到CATransition Symbol。
您是否将QuartzCore框架添加到您的应用程序中?
如果不添加它:转到您的目标设置 - >构建阶段 - >链接二进制 - >选择+按钮并选择QuartzCore。
然后导入它,你需要使用它:
#import <QuartzCore/QuartzCore.h>
我以为我已经添加了框架,复查一下,发现我还没有加入。谢了哥们。 –
有这个相同的问题,但它必须处理从另一个库导入到我的项目中的代码。如果有任何人遇到该问题,请进入“构建阶段”并将导入的文件添加到“编译源”中。 – robhasacamera
谢谢@robhasacamera,这正是我所需要的。无法弄清楚为什么我仍然有框架和导入设置正确的问题。 –