连接 QuartzCore 时出现错误

发布于 2024-08-13 16:51:33 字数 2110 浏览 5 评论 0原文

我是 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.o

ld: 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光是把杀猪刀 2024-08-20 16:51:33

你必须将 QuartzCore.framework 添加到你的目标中:

  • 右键单击应用程序目标;
  • 单击上下文菜单中的[获取信息];
  • 在[常规]选项卡中有两个列表,一个用于依赖项,另一个用于链接库;
  • 将 QuartzCore 框架添加到底部。

you have to add QuartzCore.framework to your target:

  • right click on application target;
  • click on [Get Info] in contextual menu;
  • in [General] tab there's gonna be two lists, one for dependencies, other for Linked libraries;
  • add QuartzCore framework to the botom one.
偷得浮生 2024-08-20 16:51:33

您需要确保 QuartzCore 已添加到您的项目中,然后将此行更改

#import "QuartzCore/QuartzCore.h"

#import <QuartzCore/QuartzCore.h>

:引号告诉链接器在项目源文件中查找。 '< >'告诉它寻找框架。

You need to make sure that QuartzCore is added to your project then change this line:

#import "QuartzCore/QuartzCore.h"

to:

#import <QuartzCore/QuartzCore.h>

The quotations tell the linker to look in the project source files. The '< >' tell it to look for frameworks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文