You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Swift Playground挑战项目中.xcassets无法删除移动的求助

无法在Xcode或访达中修改/删除.xcassets目录内容

我正在参与今年苹果的Swift Playground学生挑战赛,目前在Xcode中遇到了.xcassets资源目录的异常问题:无法在Xcode或访达(Finder)中删除、移动其中的内容。

  • 在Xcode内尝试移动或删除资源时会弹出错误提示,甚至删除资源目录本身也报错;
  • 切换到访达直接操作同样弹出错误(系统为法语版本,核心提示为“找不到文件”)。

我是macOS系统新手,仅开发过小型Xcode应用,从未使用过Swift Playgrounds,此前大学iOS开发课程中也遇到过.xcassets相关问题。目前已查找相关博客及帖子但未找到解决方案,该问题已困扰我两天。

项目文件结构

.
├── GreenLight.swift
├── Models
│   ├── Recordings
│   │   ├── EmotionRecording.swift
│   │   ├── RecordingType.swift
│   │   └── Recordings.swift
│   ├── Soundscape.swift
│   └── User.swift
├── Package.swift
├── README.md
├── Resources
│   ├── Assets.xcassets
│   │   ├── AppIcon.appiconset
│   │   │   └── Contents.json
│   │   ├── Contents.json
│   │   └── PlantStage
│   │       └── Contents.json
│   ├── Themes.xcassets
│   │   ├── Blue
│   │   │   ├── Contents.json
│   │   │   └── New Folder
│   │   │       └── Contents.json
│   │   ├── Contents.json
│   │   └── Green
│   │       └── Contents.json
│   └── ThemesOld.xcassets
│       ├── Action.colorset
│       │   └── Contents.json
│       ├── Blue
│       │   └── Contents.json
│       ├── Contents.json
│       ├── Error.colorset
│       │   └── Contents.json
│       ├── Green
│       │   ├── Action.colorset
│       │   │   └── Contents.json
│       │   ├── Blue
│       │   │   └── Contents.json
│       │   ├── Contents.json
│       │   ├── Error.colorset
│       │   │   └── Contents.json
│       │   ├── Highlight.colorset
│       │   │   └── Contents.json
│       │   ├── Primary.colorset
│       │   │   └── Contents.json
│       │   ├── Secondary.colorset
│       │   │   └── Contents.json
│       │   ├── Success.colorset
│       │   │   └── Contents.json
│       │   └── Warning.colorset
│       │       └── Contents.json
│       ├── Highlight.colorset
│       │   └── Contents.json
│       ├── Primary.colorset
│       │   └── Contents.json
│       ├── Secondary.colorset
│       │   └── Contents.json
│       ├── Success.colorset
│       │   └── Contents.json
│       └── Warning.colorset
│           └── Contents.json
├── Utilities
├── ViewControllers
│   └── MainViewController.swift
├── ViewModels
│   ├── GreenlightView.swift
│   ├── HomePageView.swift
│   ├── LoginView.swift
│   ├── Main.swift
│   ├── Recordings
│   │   ├── Forms
│   │   │   └── EmotionRecordingFormView.swift
│   │   ├── RecordingDetailView.swift
│   │   ├── RecordingEntriesListView.swift
│   │   └── RecordingListView.swift
│   ├── SettingsView.swift
│   └── Soundsapes
│       ├── SoundscapeCustomizationView.swift
│       └── SoundscapeListView.swift
└── Views
    ├── GlobalStatsCard.swift
    └── PlantImageView.swift

已尝试的解决方法

  • 关闭并重新打开项目
  • 重启Xcode
  • 重启电脑
  • 直接在访达中删除内容
  • 检查文件/文件夹访问权限
  • 修改文件/文件夹访问权限

我创建了多个.xcassets目录进行测试,均出现该问题。

【2024年2月21日更新】我从头创建了新项目,仅在Xcode内操作文件,未在访达中交互,但仍遇到相同问题,怀疑是否与git有关。

内容的提问来源于stack exchange,提问作者Clément COMBIER

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 10:27:51