【发布时间】:2013-10-26 14:53:43
【问题描述】:
我的应用程序在 ios 7 中运行没有问题,但是当我在 ios 6 中运行它时,它出现故障。报告是:
2013-10-17 22:58:45.509 Santarem Guide[606:c07] -[_UIAppearance setTintColor:]: unrecognized selector sent to instance 0xa149390
2013-10-17 22:58:45.510 Santarem Guide[606:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIAppearance setTintColor:]: unrecognized selector sent to instance 0xa149390'
*** First throw call stack:
(0x29d8012 0x1951e7e 0x2a634bd 0x29c7bbc 0x29c794e 0x7ade 0x8967b7 0x896da7 0x897fab 0x8a9315 0x8aa24b 0x89bcf8 0x2e69df9 0x2e69ad0 0x294dbf5 0x294d962 0x297ebb6 0x297df44 0x297de1b 0x8977da 0x89965c 0x2dfd 0x20fa725)
libc++abi.dylib: terminate called throwing an exception
(lldb)
有人遇到过这个问题吗?
在我的 App Delegate 中,我有 [[UIView 外观] setTintColor:[UIColor whiteColor]];如果我把它变成 [[UIView 外观] setBackgroundColor:[UIColor whiteColor]];我收到一个新错误,即
2013-10-17 23:08:58.310 Santarem Guide[659:c07] -[UITableView setTintColor:]:无法识别的选择器发送到实例 0x1138aa00
一切都变白了。
【问题讨论】:
-
有些方法在SDK版本之间有折旧,使用前请检查该方法是否可用。
-
我如何查看哪个已弃用?
-
if([[UIView appearance] respondsToSelector:@selector(setTintColor:)]){ [[UIView appearance] setTintColor:[UIColor whiteColor]]; }这个。 -
请不要忘记标记正确答案!
标签: ios uiview uiappearance tintcolor