【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);
        }
    }];

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

相关推荐
一个人旅程~17 小时前
关于imac27inch因改短用户名导致混合硬盘和系统崩溃的问题分析与故障解决
经验分享·笔记·macos·新浪微博
十二17 小时前
【洛谷题解】P1083 [NOIP 2012 提高组] 借教室(二分答案 + 差分)
数据结构·c++·算法·蓝桥杯
volunteer102418 小时前
从仅剩 6 GB 到狂腾 70 GB:我的 256G Mac mini 深度清理与内存排查实战
macos
青少儿编程课堂2 天前
蓝桥杯青少组省考(11/9报名截止·11/22开考)+电子学会图形化考级+信息素养大赛:校园极速跑酷闯关解析
蓝桥杯·scratch·图形化编程·信息素养大赛·电子学会考级
todoitbo2 天前
我在 Mac 上用 Docker 部署 Nexent:从拉取镜像到接入模型
macos·docker·大模型·ai智能体·nexent·快速入门与环境准备
独隅2 天前
WebStorm macOS 安装部署与高效调优实战指南
ide·macos·webstorm
fthux3 天前
Tick Rest,一个休息提醒工具的自我修养
macos·开源·swift
FPGA小迷弟4 天前
FPGA 与千兆以太网:各类物理接口的形式、区别、使用方法与应用场景详解
tcp/ip·macos·fpga开发·udp·fpga
沐梯子5 天前
MOSS-Transcribe-Diarize 和豆包语音识别哪个好?多人会议录音转写的准确率与说话人归属对比
人工智能·语音识别·xcode
周小董6 天前
[1379]mac安装nvm
macos