xcode 删除工程中的warning
1.项目中出现了如下警告
警告具体代码如下
self.navigationController.navigationBar.titleTextAttributes =
[NSDictionary dictionaryWithObjectsAndKeys:BIMRGBA(51, 51, 51, 1), UITextAttributeTextColor,
[UIFont systemFontOfSize:19], UITextAttributeFont,
[UIColor clearColor], UITextAttributeTextShadowColor, nil];
具体如下:
'UITextAttributeFont' is deprecated: first deprecated in iOS 7.0 - Use NSFontAttributeName
'UITextAttributeTextColor' is deprecated: first deprecated in iOS 7.0 - Use NSForegroundColorAttributeName
'UITextAttributeTextShadowColor' is deprecated: first deprecated in iOS 7.0 - Use NSShadowAttributeName with an NSShadow instance as the value
这个一般一起出现。
修改如下,注意下NSShadow 的位置,不能直接用[UIColor clearColor] ,必须使用NSShadow 对象,否则crash。
正确代码如下:
NSShadow *shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor clearColor];
shadow.shadowOffset = CGSizeMake(1,0);
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:BIMRGBA(51, 51, 51, 1), NSForegroundColorAttributeName,
[UIFont systemFontOfSize:19], NSFontAttributeName,
shadow, NSShadowAttributeName, nil];
2.关于warning: no rule to process file的问题
warning: no rule to process file '/Users/xx/ThirdParty/SDK-ThirdParty/TTTAttributedLabel/README.md' of type net.daringfireball.markdown for architecture i386
warning: no rule to process file '/Users/xx/ThirdParty/SDK-ThirdParty/TTTAttributedLabel/README.md' of type net.daringfireball.markdown for architecture x86_64
解决的方法很简单:在【build phases】—>【compile sources】 里面将对应的文件移除即可。
删除编译文件本文解释权归:子文
如需转载请注明出处,谢谢