- 更新xcode14, iOS16, 編譯舊項目出現(xiàn)下面問題, 找不到方法閃退.
問題截圖
-
問題描述
- <_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
補(bǔ)充
- 問題描述
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.
- 解決方案
- 重啟模擬器, 模擬器刪除應(yīng)用, 模擬器工具欄 -> Device -> Restart -> 徹底刪除應(yīng)用. 重啟項目