【iOS开发】一些常见的警告解决方案(更新中。。。)

    xiaoxiao2021-12-13  18

    Unknown pattern color for the Background Color attribute

    1.背景色属性为未知模式的颜色

    解决:默认xib里面控件的背景色为Default。如果出现警告,可能是你定义的颜色Xcode启动时识别不了,请重新检查每个控件的背景色,在设置一下颜色就可以了。


    Unused variable ‘temString’

    2.变量没有被使用

    解决:变量定义了,可是没有使用,可以考虑把这个变量删除掉。


    <1>Format specifies type ‘unsigned long’ but the argument has type ‘unsigned int’

    <2>Values of type ‘NSInteger’ should not be used as format arguments; add an explicit cast to ‘long’ instead

    3.这个警告一般会出现在NSStringWithFormat里面 前面%d %lu 什么的和后面填进去的参数不匹配就报了警告

    解决:NSLog(@”data: %ld bytes”, (unsigned long)[(NSData*)obj length]);


    ‘sizeWithFont:constrainedToSize:lineBreakMode:’ is deprecated: first deprecated in iOS 7.0 - Use -boundingRectWithSize:options:attributes:context:

    4.方法太旧,被废除了。

    解决:旧的方法sizeWithFontToSize在iOS7后就废除了取而代之是boundingRectWithSize方法


    Method definition for ‘shareIHEFESDK’ not found

    5. .h 申明的方法没有实现函数

    解决:在 .m 文件中实现 - (void)shareIHEFESDK{ }方法。


    6.Xcode Archive出来的包在本地Organizer中看到的App没有图标的问题

    解决:检查App中得xxx-info.plist文件中,添加Icon file属性,并填上非retian和Retian屏幕对应的icon文件名称(文件必须存在,且命名如下),如下图所示:

    再次Archive即可发现,本地的Organizerz中的App有icon了。


    转载请注明原文地址: https://ju.6miu.com/read-950249.html

    最新回复(0)