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

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

相关推荐
EVE จุ๊บ1 天前
如何修改mac上的jmeter堆内存
jmeter·macos
HZY1618yzh1 天前
洛谷题解:P16304 [蓝桥杯 2026 省 Java C 组] 抽奖活动
java·c++·算法·蓝桥杯
老蒋每日coding1 天前
Node.js 安装指南(Mac 版本)
macos·node.js
AI玫瑰助手1 天前
Python入门:Windows/macOS/Linux系统安装Python教程
windows·python·macos
智算菩萨1 天前
OpenAI Codex 国内使用完全指南:Windows/macOS/Linux 三平台详细安装配置教程(现在最新的有gpt-5.3-codex和gpt-5.4)
linux·windows·gpt·macos·ai·ai编程·codex
AAI机器之心1 天前
在 macOS 上本地部署 Ollama + LLaMA3(附教程)
人工智能·macos·langchain·llm·知识库·大模型部署
HSTK1 天前
Mac上配置PlatformIO
macos
空中海2 天前
iOS 动态分析、抓包与 Frida Hook
ios·职场和发展·蓝桥杯
于慨2 天前
firecrawl
macos
vooy pktc2 天前
macOS安装Redis
数据库·redis·macos