10

我正在尝试做半页卷曲功能。这是我正在使用的代码:

#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)

我该如何解决?

4

1 回答 1

23

您的应用程序抱怨找不到 CATransition 符号。

您是否将 QuartzCore 框架添加到您的应用程序中?

如果不添加:转到您的目标设置 -> 构建阶段 -> 链接二进制文件 -> 选择 + 按钮并选择 QuartzCore。

然后将其导入您需要使用它的地方:

      #import <QuartzCore/QuartzCore.h>
于 2011-12-12T09:10:48.810 回答