使用 CALayer 时无法编译代码
由于某种原因,当我尝试使用 CALayer 时,我收到链接器错误:
"_OBJC_CLASS_$_CALayer", referenced from:
我导入了以下标头:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
代码:
arrowImage = [[CALayer alloc] init];
For some reason I get linker errors when I try and use CALayer:
"_OBJC_CLASS_$_CALayer", referenced from:
I have imported the following headers:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
Code:
arrowImage = [[CALayer alloc] init];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您还将 QuartzCore 框架添加到您的目标中。仅导入标头是不够的。
XCode 截图
Make sure you also add the QuartzCore framework to your target. Just importing the header isn't enough.
XCode Screenshot