Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSString的containsString是在iOS8以上的方法,在iOS7中会崩溃 #404

Closed
zhmch0329 opened this issue Jul 15, 2016 · 2 comments
Closed

Comments

@zhmch0329
Copy link

YYLabel.m中的setFontName_:方法中使用了containsString:方法,在YYTextView中也同样使用了这个iOS8以上才提供的方法。建议使用([str rangeOfString:@"target"].length > 0)代替

@ibireme
Copy link
Owner

ibireme commented Jul 15, 2016

感谢指出问题。

目前只有在用 InterfaceBuilder 来手动填写 FontName 时才会遇到,再加上 YYKit 和 YYTextDemo 里为了兼容旧版本已经重写了 containsString 方法,所以一直没注意到吧,疏忽了。

Fixed: eb6ab79

@zhmch0329
Copy link
Author

我也是被这个方法坑过好几次了,然后就稍微注意了一下😂

@ibireme ibireme closed this as completed Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants