iphone - 尝试使用 QuartzCore 动画时收到错误消息

标签 iphone ios quartz-core

我有一个重播级别按钮。当用户按下此重播级别按钮时,我重置所有游戏属性以重置级别。但是,这还不够。我还想让关卡看起来像是全新的,所以我想向 View Controller 添加动画,就像模态转场的交叉溶解动画一样。为此,我将此代码添加到我的 replayLevel 方法中。

-(IBAction)replayLevel:(id)sender
{
//reset my levels properties
[self resetGameProperties];

//add the cool modal cross dissolve animation

CATransition *transition =[CATransition animation];
transition.duration=.5;
transition.type=kCATransitionFade;
transition.delegate=self;
[self.view.layer addAnimation:transition forKey:nil];
self.view.hidden=YES;
self.view.hidden=NO;

}

我还在我的界面文件中记得添加

#import <QuartzCore/QuartzCore.h>

一切似乎都很好,除了当我构建并运行时我收到此错误消息

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CATransition", referenced from:
      objc-class-ref in ViewController.o
  "_kCATransitionFade", referenced from:
      -[ViewController replayButton:] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

如果我复制模态交叉溶解转场的代码很糟糕,我很乐意接受关于我应该如何做的任何不同意见,但除此之外,任何人都可以帮助我消除这个错误吗?

任何帮助都非常有帮助!

最佳答案

您需要将 QuartzCore 框架添加到您的目标。

How to "add existing frameworks" in Xcode 4?

关于iphone - 尝试使用 QuartzCore 动画时收到错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11803065/

相关文章:

iphone - 有适用于 MAC OS X 的免费 SQLite 管理器吗?

ios - 响应式设计 Xcode 6 - 如何设置约束以使您的设计响应式?

ios - 秒表应用计数器走得太快

iphone - 用于 iOS 聚合的 CoreData 或 SQLite

iphone - 在 iOS 中使用 Google Plus 分享图片

swift - PDFView osx 中突出显示的选择

ios - 围绕 anchor 将图像旋转 90 度

iphone - CATransform3DRotate 旋转 360 度

iphone - 生成新证书后推送通知不起作用

ios - 需要获取 UITextField 的占位符文本