我是Objective C和iPhone开发的新手,但这正是我想要做的......问题在于QuartzCore和基本动画的东西。这些行来自我的applicationDelegate
:
#import "QuartzCore/QuartzCore.h"
...
-(void)performTransition {
if(!transitioning) {
CATransition *transition = [CATransition animation];
transition.duration = 0.9;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = (isInMainDialog) ? kCATransitionFromRight : kCATransitionFromLeft;
transitioning = YES;
transition.delegate = self;
[window.layer addAnimation:transition forKey:nil];
if (isInMainDialog) {
mainController.view.hidden = YES;
levelController.view.hidden = NO;
isInMainDialog = false;
// start game
[levelController playLevel:1 balls:3 scores:0];
}
else {
mainController.view.hidden = NO;
levelController.view.hidden = YES;
isInMainDialog = true;
}
}
}
好吧..这个applicationDelegate编译好了,但是当构建以下错误时:
“_ kCATransitionFromRight”,引自: eBreakAppDelegate.o中的_kCATransitionFromRight $ non_lazy_ptr
“_ kCAMediaTimingFunctionEaseInEaseOut”,引自: eBreakAppDelegate.o中的_kCAMediaTimingFunctionEaseInEaseOut $ non_lazy_ptr
“_ kCATransitionMoveIn”,引自: eBreakAppDelegate.o中的_kCATransitionMoveIn $ non_lazy_ptr
“。objc_class_name_CAMediaTimingFunction”,引自: eBreakAppDelegate.o中的文字指针@__ OBJC @__ cls_refs @ CAMediaTimingFunction
“_ kCATransitionFromLeft”,引自: eBreakAppDelegate.o中的_kCATransitionFromLeft $ non_lazy_ptr
“。objc_class_name_CATransition”,引自: eBreakAppDelegate.o中的文字指针@__ OBJC @__ cls_refs @ CATransition
ld:未找到符号
collect2:ld返回1退出状态
所以,我猜连接存在问题,因为在编译时没有问题。我应该如何将石英与我的项目联系起来,或者如何解决这个问题呢?
答案 0 :(得分:4)
你必须将QuartzCore.framework添加到你的目标:
答案 1 :(得分:0)
您需要确保将QuartzCore添加到项目中,然后更改此行:
#import "QuartzCore/QuartzCore.h"
为:
#import <QuartzCore/QuartzCore.h>
引用告诉链接器查看项目源文件。 '&lt; &GT;”告诉它寻找框架。