Xcode iPhone - 添加框架有点作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1104207/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:39:57  来源:igfitidea点击:

Xcode iPhone - Adding framework works a little bit

iphonexcodeframeworksavfoundation

提问by quano

No biggie, but when I add the AVFoundation framework for the iPhone, it turns red for some reason I'm unable to figure out why. The project will not compile unless I add this framework, and if I do, Xcode will mark the framework red (apparently that means xcode cannot find the framework), but yet it will work.

没什么大不了的,但是当我为 iPhone 添加 AVFoundation 框架时,它由于某种原因变成了红色,我不知道为什么。除非我添加这个框架,否则项目不会编译,如果我这样做,Xcode 会将框架标记为红色(显然这意味着 xcode 找不到框架),但它仍然可以工作。

This is quite annoying. Any clue what I might be doing wrong here?

这很烦人。任何线索我可能在这里做错了什么?

回答by David Wong

Try adding AVFoundation framework via your target.

尝试通过您的目标添加 AVFoundation 框架。

  1. Look for your target under "Groups and Files"
  2. "Get Info" for it
  3. Click the "General" tab
  4. At the bottom right of the window click the "+" button
  5. At the top of your list you should find AVFoundation, add it.
  1. 在“组和文件”下查找您的目标
  2. 为它“获取信息”
  3. 单击“常规”选项卡
  4. 单击窗口右下角的“+”按钮
  5. 在您的列表顶部,您应该找到 AVFoundation,添加它。

回答by quano

  1. close Xcode
  2. delete your project
  3. shut down your mac
  4. take the mac back to your boss and tell him it's not working
  5. wait until they figure out what it is
  6. if this doesn't work, find a new job that doesn't require the use of a mac
  1. 关闭 Xcode
  2. 删除你的项目
  3. 关闭你的 Mac
  4. 把 mac 带回你的老板,告诉他它不工作
  5. 等到他们弄清楚它是什么
  6. 如果这不起作用,请找一份不需要使用 mac 的新工作

All I had to do was open up the "General" settings tab for the project and change the "Base SDK for All Configurations" value. It was set to an SDK that I no longer had installed.

我所要做的就是打开项目的“常规”设置选项卡并更改“所有配置的基础 SDK”值。它被设置为我不再安装的 SDK。