When to check “Copy items if needed” for embedded binaries?

后端 未结 3 591
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-11 20:02

When I tried to put a third-party framework(installed by carthage) in the embedded binaries, I got such an option. I got confused, since \"Embedded binaries are binary files

相关标签:
3条回答
  • 2021-01-11 20:09

    Copy items if needed usually (but not always, e.g. the project already contains this item) copies files into your project directory as a result you can use relative path(instead of absolute) safely. For example when you use some version control your team members will not have some troubles with solving issues with paths

    In case of third-party framework you can use $(PROJECT_DIR) in Build Settings -> Framework Search Paths

    [Create groups vs Create folder reference]

    0 讨论(0)
  • 2021-01-11 20:25

    "Copy items if needed" has nothing to do with the building of your app. It means copied into the project folder, right now (if it isn't in the project folder already). I suggest you always say yes, because otherwise your project might end up depending upon stuff that isn't in the project folder, and which you might therefore throw away or rename by accident, thus causing your project to break.

    0 讨论(0)
  • 2021-01-11 20:31

    Like matt has said, I recommend you always leave it selected as well. I have had troubles uploading the app, even though I know I have not moved or renamed the file. Also an extra benefit of leaving it enabled is that it makes it easier to share the project with others without having to track down the files not in the project folder.

    I can see two cases why leaving it off might be convenient:

    1. You have multiple projects which share the same file and want to reduce space,
    2. You desperately need to save the space on your computer, in which case I would buy extra storage for your computer.

    Edit: Even though you copied the file in, XCode treats it as a link to the file, this is why you are seeing this message.

    0 讨论(0)
提交回复
热议问题