简体   繁体   中英

Trouble adding files to Xcode project

I am trying to add 2 swift files to my Xcode project. They are located on my desktop currently. When I open them up, they look like this:

常规文件

However, when I add them to my Xcode project, they look like this:

导入文件

How can I add these files without the text messing up? Thanks!

That looks suspiciously like some kind of PNG file, not a text file. ("PNG" followed by "IHDR", specifically.) Are you sure that's a Swift file and not a screenshot of a Swift file or something?

That's also a very strange title in the titlebar of your screenshot. Perhaps that is related.

Either way, seems pretty clear that these allegedly Swift files are actually some format which is not plain text. Copy the text out of it into a new file created from scratch by Xcode, and that will fix whatever the problem is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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