FXLabel因UILabel错误而崩溃 [英] FXLabel crash with UILabel error

查看:103
本文介绍了FXLabel因UILabel错误而崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置FXLabel https://github.com/nicklockwood/FXLabel 我的项目,但我得到一个错误,我无法解释。我正在使用Interface Builder来管理该属性。

I am trying to set up FXLabel https://github.com/nicklockwood/FXLabel in my project but i get an error i cant explain. I am using Interface Builder to manage the property.

.h文件

@property (nonatomic) IBOutlet FXLabel *titleLabel;

.m文件

self.titleLabel.shadowColor = [UIColor colorWithWhite:1.0f alpha:0.8f];
self.titleLabel.shadowOffset = CGSizeMake(1.0f, 2.0f);
self.titleLabel.shadowBlur = 1.0f;
self.titleLabel.innerShadowColor = [UIColor colorWithWhite:0.0f alpha:0.8f];
self.titleLabel.innerShadowOffset = CGSizeMake(1.0f, 2.0f);

.xbi文件


尝试编译时&运行错误会在此行中抛出

When trying to compile & run an error gets thrown in this line

self.titleLabel.innerShadowColor = [UIColor colorWithWhite:0.0f alpha:0.8f];

并且错误看起来像这样:

Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '-[UILabel setInnerShadowColor:]: unrecognized selector sent to 
instance 0x6e56180'

我想某种程度上编译器认为它是UILabel而不是FXLabel(它显然是)。
i无法找到解决方法,任何想法可能是什么问题或我可以尝试什么?

i guess somehow the compiler thinks it is a UILabel instead of an FXLabel (which it clearly is). i cant find a work around it, any ideas what might be the problem or what i could try?

提前感谢
sebastian

thanks in advance sebastian

推荐答案

清洁& Build + Restarting XCode解决了这个问题。

Clean & Build + Restarting XCode solved the problem.

这篇关于FXLabel因UILabel错误而崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆