gpt4 book ai didi

ios - 我的应用程序在 ios6 中使用 UIAppearance setTintColor 关闭

转载 作者:可可西里 更新时间:2023-11-01 04:16:00 25 4
gpt4 key购买 nike

我的应用程序在 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 appearance] setTintColor:[UIColor whiteColor]];如果我把它变成 [[UIView appearance] setBackgroundColor:[UIColor whiteColor]];我收到一个新错误

2013-10-17 23:08:58.310 Santarem Guide[659:c07] -[UITableView setTintColor:]: 无法识别的选择器发送到实例 0x1138aa00

一切都变白了。

最佳答案

您应该在使用前检查该方法是否可用。

if ([[UIView appearance] respondsToSelector:@selector(setTintColor:)]) {
[[UIView appearance] setTintColor:[UIColor whiteColor]];
}

关于ios - 我的应用程序在 ios6 中使用 UIAppearance setTintColor 关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19438199/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com