我目前在创建动画NSTextField子类时遇到问题。
#import <QuartzCore/QuartzCore.h>
#import "QuartzCore/CAMediaTimingFunction.h"
#import "CMFadingTextField.h"
@implementation FadingTextField
-(void)setAnimatedStringValue:(NSString *)string
{
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:1.0];
[context setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
[self.animator setAlphaValue:0.0];
}
completionHandler:^{
[self setStringValue:string];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:1.0];
[context setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[self.animator setAlphaValue:1.0];
}
completionHandler:^{}];
}];
}
@end
当我编译它时,我收到此错误:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CAMediaTimingFunction", referenced from:
objc-class-ref in FadingTextField.o
"_kCAMediaTimingFunctionEaseIn", referenced from:
___44-[FadingTextField setAnimatedStringValue:]_block_invoke_2 in FadingTextField.o
"_kCAMediaTimingFunctionEaseOut", referenced from:
___44-[FadingTextField setAnimatedStringValue:]_block_invoke in FadingTextField.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我已经导入了QuartzCore,所以我不明白这是什么问题。
答案 0 :(得分:-1)
选择您的项目 - &gt;目标 - &gt;构建设置 - &gt;架构 - &gt;有效的架构 - &gt;尝试删除标记'arm64'。