连接 QuartzCore 时出现错误
我是 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退出状态
所以,我猜测链接有问题,因为编译时没有问题。我应该以某种方式将石英链接到我的项目还是如何解决这个问题?
I am new with Objective C and iPhone development but that is what I am trying to do... Problem is with QuartzCore and basic animation stuff. These lines are from my 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;
}
}
}
okay.. This applicationDelegate compiles ok, but when building following errors happen:
"_kCATransitionFromRight", referenced from:
_kCATransitionFromRight$non_lazy_ptr in eBreakAppDelegate.o"_kCAMediaTimingFunctionEaseInEaseOut", referenced from:
_kCAMediaTimingFunctionEaseInEaseOut$non_lazy_ptr in eBreakAppDelegate.o"_kCATransitionMoveIn", referenced from:
_kCATransitionMoveIn$non_lazy_ptr in eBreakAppDelegate.o".objc_class_name_CAMediaTimingFunction", referenced from:
literal-pointer@__OBJC@__cls_refs@CAMediaTimingFunction in eBreakAppDelegate.o"_kCATransitionFromLeft", referenced from:
_kCATransitionFromLeft$non_lazy_ptr in eBreakAppDelegate.o".objc_class_name_CATransition", referenced from:
literal-pointer@__OBJC@__cls_refs@CATransition in eBreakAppDelegate.old: symbol(s) not found
collect2: ld returned 1 exit status
So, I guess there is a problem in linking, because there is no problems at compile time. Should I, some how, link the quartz to my project or how could this be fixed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你必须将 QuartzCore.framework 添加到你的目标中:
you have to add QuartzCore.framework to your target:
您需要确保 QuartzCore 已添加到您的项目中,然后将此行更改
为
:引号告诉链接器在项目源文件中查找。 '< >'告诉它寻找框架。
You need to make sure that QuartzCore is added to your project then change this line:
to:
The quotations tell the linker to look in the project source files. The '< >' tell it to look for frameworks.