将 QuartzCore 框架导入 Xcode 项目的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6518946/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Problem importing QuartzCore framework into Xcode project
提问by Sabobin
I am using Xcode 4.
我正在使用 Xcode 4。
I am trying to import the QuartzCore framework into my Xcode project but I get the following compilation error:
我正在尝试将 QuartzCore 框架导入到我的 Xcode 项目中,但出现以下编译错误:
/Users/sabobin/Desktop/PlayingCard/PlayingCard/PlayingCardViewController.m:10:26: error: Quartz/Quartz.h: No such file or directory
file://localhost/Users/sabobin/Desktop/PlayingCard/PlayingCard/PlayingCardViewController.m: error: Lexical or Preprocessor Issue: 'Quartz/Quartz.h' file not found
/Users/sabobin/Desktop/PlayingCard/PlayingCard/PlayingCardViewController.m:10:26: 错误: Quartz/Quartz.h: 没有那个文件或目录
file://localhost/Users/sabobin/Desktop/PlayingCard/PlayingCard/PlayingCardViewController.m:错误:词法或预处理器问题:找不到“Quartz/Quartz.h”文件
I navigated to the project target, and selected the Build Phases tab, and then added QuartzCore.framework to the Link Binary With Libraries section.
我导航到项目目标,选择 Build Phases 选项卡,然后将 QuartzCore.framework 添加到 Link Binary With Libraries 部分。
I then used the following import statement in my view controllers implementation file:
然后我在我的视图控制器实现文件中使用了以下导入语句:
#import <Quartz/Quartz.h>
Does anyone have any ideas?
有没有人有任何想法?
Thanks in advance.
提前致谢。
回答by iMOBDEV
It should have
它应该有
#import <QuartzCore/QuartzCore.h>
回答by Anomie
The correct line is #import <QuartzCore/QuartzCore.h>
.
正确的行是#import <QuartzCore/QuartzCore.h>
。
回答by Tendulkar
It may help you.
它可能会帮助你。
#import<QuartzCore/QuartzCore.h>
回答by Suresh Varma
I am wondering What made you write #import <Quartz/Quartz.h>
When the framework you are importing is QuartzCore.
我想知道是什么让你写的#import <Quartz/Quartz.h>
时候你导入的框架是QuartzCore。
So the correct one as already pointed out by others is #import<QuartzCore/QuartzCore.h>
所以其他人已经指出的正确的是 #import<QuartzCore/QuartzCore.h>
回答by CrazyOne
You no longer need to import QuartzCore as of iOS 7, since it is already included when you "import UIKit".
从 iOS 7 开始,您不再需要导入 QuartzCore,因为它在您“导入 UIKit”时已经包含在内。
回答by CrazyOne
Should use
应该使用
#import <QuartzCore/QuartzCore.h>
after importing the QuartzCore.framework from Link Binary With Libraries under Build phase in Xcode.
在 Xcode 的 Build 阶段从 Link Binary With Libraries 导入 QuartzCore.framework 之后。