使用CALayer时无法编译代码 [英] Can't compile code when working with CALayer
本文介绍了使用CALayer时无法编译代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于某种原因,当我尝试使用CALayer时,我遇到链接器错误:
For some reason I get linker errors when I try and use CALayer:
"_OBJC_CLASS_$_CALayer", referenced from:
我已导入以下标题:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
代码:
arrowImage = [[CALayer alloc] init];
推荐答案
确保您还将QuartzCore框架添加到目标。只导入标头是不够的。
Make sure you also add the QuartzCore framework to your target. Just importing the header isn't enough.
XCode截图
XCode Screenshot
这篇关于使用CALayer时无法编译代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文