FXLabel crash with UILabel error

爱⌒轻易说出口 提交于 2019-12-11 17:55:11

问题


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 File

@property (nonatomic) IBOutlet FXLabel *titleLabel;

.m File

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 File

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

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

and the error looks like that:

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

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?

thanks in advance sebastian


回答1:


Clean & Build + Restarting XCode solved the problem.



来源:https://stackoverflow.com/questions/10968425/fxlabel-crash-with-uilabel-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!