我在我的应用上使用DAKeyboardControll
。 它有一个方法名称为:swizzled_addSubview
并实施像这样:最近我与自动版式兼容的,我接受这种方法的一些崩溃新版递归调整导致崩溃
- (void)swizzled_addSubview:(UIView *)subview
{
if (!subview.inputAccessoryView)
{
if ([subview isKindOfClass:[UITextField class]])
{
UITextField *textField = (UITextField *)subview;
if ([textField respondsToSelector:@selector(setInputAccessoryView:)])
{
UIView *nullView = [[UIView alloc] initWithFrame:CGRectZero];
nullView.backgroundColor = [UIColor clearColor];
textField.inputAccessoryView = nullView;
}
}
else if ([subview isKindOfClass:[UITextView class]]) {
UITextView *textView = (UITextView *)subview;
if ([textView respondsToSelector:@selector(setInputAccessoryView:)] && [textView respondsToSelector:@selector(isEditable)] && textView.isEditable)
{
UIView *nullView = [[UIView alloc] initWithFrame:CGRectZero];
nullView.backgroundColor = [UIColor clearColor];
textView.inputAccessoryView = nullView;
}
}
}
[self swizzled_addSubview:subview];
}
问题
,并把它们的原因: -[UIView(DAKeyboardControl) swizzled_addSubview:]
, EXC_BAD_ACCESS KERN_PROTECTION_FAILURE at 0x0090dffc
我知道这个问题已经发生了很多很多的电话,但为什么它不能正常工作?
这次事故发生的次数为54次,仅有8个用户,其中50%有越狱设备,但另一个人有非越狱设备!
你有使用DAKeyboard的这个问题吗? 谢谢你的回复 – Mohamad
绝对比搅拌好。 Swizzling不属于生产代码。 – gnasher729
是的,我之前有同样的问题。 –