解决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以上。

相关推荐
sphw7 小时前
nixnb: Jupyter Notebook 优雅分享
ide·人工智能·jupyter
计算机内卷的N天20 小时前
CMake与Visual Studio的使用
c++·ide·visual studio
咱入行浅20 小时前
一款实用的 Visual Studio 发布部署插件,助力提高部署效率!
ide·visual studio
起司喵喵20 小时前
Flutter-MacOS桌面OS系统|flutter.+window_manager客户端OS模板
flutter·macos·策略模式
代码对我眨眼睛20 小时前
macOS Google Chrome 常用快捷键
前端·chrome·macos
谢斯21 小时前
[vscode] 使用unity打开vscode的取消.csproj的显示
ide·vscode·unity
啊真真真21 小时前
macOS下libnfc ..写卡失败问题及解决方案
macos·策略模式
叶 落1 天前
Mac 通过 Miniconda 安装 Python
python·macos·conda·miniconda
2501_916007471 天前
SwiftUI 声明式语法与 Xcode 预览功能详解
ide·vscode·ios·swiftui·个人开发·xcode·敏捷流程
it-电商达人1 天前
告别手动对齐!Mac播放器Popvee Player支持本地AI自动生成字幕
人工智能·macos