无法将图像添加到 Xcode 中的图像按钮

Unable to add images to image button in Xcode

我是 macOS 应用程序开发的新手 我正在尝试将图像按钮添加到我的视图中,我想在文本之后看到图像,所以我拖放图像按钮以查看控制器并编写标题和之后那,在图像部分我选择我的图像。

但我的问题是,如果我选择系统图像,我的项目将完美运行,但如果我将通过单击项目名称 > 添加文件到.. 并将 png、jpg、jpeg 文件导入我的项目并选择这张图片 Xcode 给我这个错误;

CodeSign build/Debug/test.app
    cd /Users/feora/Documents/apps/test
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

Signing Identity:     "-"

    /usr/bin/codesign --force --sign - --entitlements /Users/feora/Documents/apps/test/build/test.build/Debug/test.build/test.app.xcent --timestamp=none /Users/feora/Documents/apps/test/build/Debug/test.app

/Users/feora/Documents/apps/test/build/Debug/test.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

this page 出了点问题,但我找不到哪个

那是因为当您添加图像文件时,您也会添加一些与该图像相关的 Finder 元数据。如果你搜索过错误,你至少会得到一点点,你会找到像 .

这样的答案