解决Xcode报错Stored properties cannot be marked unavailable with ‘@available‘

出现场景

打开一个IOS老项目时,Xcode提示以下错误

swift 复制代码
@available(iOS, unavailable) //Stored properties cannot be marked unavailable with '@available'

解决方案

我们只需要把unavailable改成*号,同时增加版本号的限制。

swift 复制代码
//  @available(iOS, unavailable)
@available(iOS 15.0, *)

或者在Pod中将指定版本改为14.0以上。

相关推荐
一张假钞17 分钟前
Mac OS 安装 VirtualBox
macos·virtualbox
哦豁灬21 分钟前
macOS 基本使用
macos
齐行超1 小时前
SwiftUI NavigatorStack 导航容器
ios·swiftui·navigationstack·navigationpath·navigationlink
aerror2 小时前
如何解压一个MacOs PKG 安装包修改内容后重新打包
macos
猫头虎2 小时前
openAI发布的AI浏览器:什么是Atlas?(含 ChatGPT 浏览功能)macOS 离线下载安装Atlas完整教程
人工智能·macos·chatgpt·langchain·prompt·aigc·agi
fukai77222 小时前
uTools 最新版优化macOS 26 高 GPU 占用问题
macos
Cosmoshhhyyy2 小时前
macOS环境安装jupyter notebook(极简版)
ide·macos·jupyter
夕秋一梦3 小时前
mac 安装 dmg 格式程序,打开显示已损坏问题
macos
西贝爱学习5 小时前
快速下载jdk17+Android Studio 2025
android·ide·android studio
AAA小肥杨5 小时前
Mac 从零开始配置 VS Code + Claude/Codex AI 协同开发环境教程
人工智能·macos·ai·mcp