简体   繁体   English

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

[英]Unable to add images to image button in Xcode

I'm new for macOS app development I'm trying to add image button to my view and I wanna see image after the text, so I'm dragging & dropping image button to view controller and writing title and after that, in image section I choose my image. 我是macOS应用程序开发的新手,我试图在视图中添加图像按钮,我想在文本后看到图像,因此我将图像按钮拖放到视图控制器中并写标题,然后在图像部分我选择我的形象。

But my issue is if I will choose the system images my project works perfectly but if I will import a file by clicking project name > add files to.. and importing png, jpg,jpeg file to my project and choosing this image Xcode gives me this error; 但是我的问题是,如果我选择系统映像,则我的项目可以正常运行,但是如果我要通过单击项目名称>将文件添加到..,然后将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

Something is wrong with this page but I can't find which one 此页面有问题,但我找不到哪一个

That's because when you're add image file you're also adding some Finder metadata related to that image. 那是因为当您添加图像文件时,您还添加了一些与该图像相关的Finder元数据。 If you've searched error you're getting at least a little bit, you'd have found answers like this . 如果你搜索错误你至少得到一点点,你会发现喜欢回答这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM