iOS16 xcode14 更新问题

  • 更新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 -> 彻底删除应用. 重启项目
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。