- 更新xcode14, iOS16, 编译旧项目出现下面问题, 找不到方法闪退.
-
问题描述
- <_UINavigationBarContentViewLayout 0x7f7f53f58a40> valueForUndefinedKey:]: this class is not key value coding-compliant for the key inlineTitleView.
问题解决
#if DEBUG
@interface Xcode14Beta4Fixer : NSObject
@end
@implementation Xcode14Beta4Fixer
+ (void)load
{
Class cls = NSClassFromString(@"_UINavigationBarContentViewLayout");
SEL selector = @selector(valueForUndefinedKey:);
Method impMethod = class_getInstanceMethod([self class], selector);
if (impMethod) {
class_addMethod(cls, selector, method_getImplementation(impMethod), method_getTypeEncoding(impMethod));
}
}
- (id)valueForUndefinedKey:(NSString *)key
{
return nil;
}
@end
#endif
补充
- 问题描述
Message from debugger: Xcode has killed the LLDB RPC server to allow the debugger to detach from your process. You may need to manually terminate your process.
- 解决方案
- 重启模拟器, 模拟器删除应用, 模拟器工具栏 -> Device -> Restart -> 彻底删除应用. 重启项目