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

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

相关推荐
Architect_Lee14 小时前
mac快速安装mysql
数据库·mysql·macos
User_芊芊君子16 小时前
STT + LLM + TTS:用一条流水线搓了个中英双向翻译助手
ide·macos·xcode
凤山老林1 天前
在 Apple 芯片的 Mac 上通过 VMware Fusion 使用 Windows 11
windows·macos·vmware·虚拟机
c&0xff001 天前
mac通过网线连接树莓派
macos
孙启超2 天前
Token太贵自己写了一个mac版开源AI编程工具
人工智能·macos·开源·llm·agent·ai编程·ai应用开发
2601_965798472 天前
Launch Your Wellness App Fast: The Truth About Meditation Source Code
前端·macos·ios·objective-c·cocoa
依然鸣3 天前
PTA团体程序设计天梯赛L2真题讲解L2-037-040
c++·经验分享·学习·算法·蓝桥杯·深度优先·pat考试
YuforiaCode3 天前
第十六届蓝桥杯 2025 C/C++组 数列差分
c语言·c++·蓝桥杯
QAQo7T3 天前
Python组蓝桥杯备赛超详细知识点总结笔记_排序算法篇
笔记·python·算法·蓝桥杯·排序算法
普通网友3 天前
蓝桥杯 DP 优化:从 O (n²) 到 O (n) 的滚动数组实战
职场和发展·蓝桥杯