【Xcode 26.4】报错netinet6/in6.h和comparison ‘X < Y < Z‘

背景:

Xcode 26.4 原生工程运行报错

问题1:

Use of private header from outside its module: 'netinet6/in6.h'

原因:直接导入 netinet6/in6.h 在新版 Xcode 中是不允许的。最佳实践是使用标准的 netinet/in.h 和 arpa/inet.h 来替代,这些头文件提供了相同的 IPv6 功能,且是公开的、受支持的 API。

目前以下三方库都涉及:

临时解决方案:删掉,等第三方优化再更新吧。

记得右上角解锁再删,不影响debug。pod后会覆盖,需要再删除,或者脚本一下也可以。


问题2:

*****/YYText/Component/YYTextLayout.m:1508:69 Chained comparison 'X < Y < Z' does not behave the same as a mathematical expression

原因:运算符不支持,扩写

以前:

if (5 < 10 < 20) {

// This would actually be: (5 < 10) < 20 → 1 < 20 → true

// But it won't work correctly for all cases

}

修改为:

if (5 < 10 && 10 < 20) {

// This correctly evaluates to true

}

临时解决方案:

YYTextLayout:

bash 复制代码
    [self _insideComposedCharacterSequences:line position:position block: ^(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next) {
        if (isVertical) {
            position = fabs(left - point.y) < fabs(right - point.y)&&fabs(right - point.y) < (right ? prev : next);
        } else {
            position = fabs(left - point.x) < fabs(right - point.x) &&fabs(right - point.x) < (right ? prev : next);
        }
    }];
    
    [self _insideEmoji:line position:position block: ^(CGFloat left, CGFloat right, NSUInteger prev, NSUInteger next) {
        if (isVertical) {
            position = fabs(left - point.y) < fabs(right - point.y)&&fabs(right - point.y) < (right ? prev : next);
        } else {
            position = fabs(left - point.x) < fabs(right - point.x)&&fabs(right - point.x) < (right ? prev : next);
        }
    }];

最后,注意是临时方案!!后面等第三方兼容。

相关推荐
HackTwoHub7 小时前
BurpSuite2026.8专业(稳定版)下载Windows/Linux/Mac支持Java21以上(新增Burp AT智能体)
linux·运维·服务器·安全·macos·网络安全·自动化
海鸥两三8 小时前
Mac电脑使用 Tabby 部署前端项目到阿里云服务器完整教程
前端·macos·阿里云
aqiu11111110 小时前
【并查集 / 图论】蓝桥云课 - 魔法大陆的城市群(求无向图连通块数量)题解
蓝桥杯·图论
阿沐沐,11 小时前
Claude Code 安装教程:Windows、WSL 2 与 macOS
windows·macos
山野万澫里12 小时前
新版macOS取消了启动台,老用户该如何适配?
macos·mac·启动台
getapi13 小时前
1 在 macOS 电脑上更新 Flutter iOS 应用到 App Store
flutter·macos·ios
aqiu1111111 天前
【LeetCode 902】最大为 N 的数字组合 - 详细题解与数位组合思路
数据结构·算法·leetcode·蓝桥杯·数位dp
ACP广源盛139246256731 天前
M6/M5 Pro Mac mini 端侧 AI 落地@ACP#YLB3116 中端多盘存储扩展在 AI 服务中的机会与应用场景
大数据·网络·数据库·人工智能·嵌入式硬件·macos
ACP广源盛139246256731 天前
M6/M5 Pro Mac mini 端侧 AI 新形态@ACP#GSV5800 Serdes 长距离视频传输在 AI 服务中的机会与落地场景
大数据·网络·数据库·人工智能·嵌入式硬件·macos·音视频
mashang1234567891 天前
mac安装SnailGitLite并配置Beyond Compare
前端·macos