xcode 如何再次添加已删除的框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10433804/
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
How to add deleted frameworks again
提问by Shailesh
I accidentally deleted AVFoundation , CoreFoundation , Foundation and UIKit.framework , CoreGraphics.frameworks frameworks form my Xcode. Is there any ways to restore them.. or i will have to re-install the Xcode again.
我不小心从我的 Xcode 中删除了 AVFoundation 、 CoreFoundation 、 Foundation 和 UIKit.framework 、 CoreGraphics.frameworks 框架。有什么方法可以恢复它们.. 或者我将不得不再次重新安装 Xcode。
回答by 555nick
If you haven't emptied the trash yet, close Xcode and open the Trash in Finder. Find the framework folder you accidentally deleted. In Finder, open another window with the path /System/Library/Frameworks
(beginning on Macintosh HD if you want to open the folder manually), and drag-copy the framework from the Trash to the Frameworks folder. Reopen Xcode and you should be able to add the framework again in the target settings.
如果您还没有清空垃圾箱,请关闭 Xcode 并在 Finder 中打开垃圾箱。找到您不小心删除的框架文件夹。在 Finder 中,打开另一个带有路径的窗口/System/Library/Frameworks
(如果您想手动打开文件夹,则从 Macintosh HD 开始),然后将框架从废纸篓拖复制到 Frameworks 文件夹。重新打开 Xcode,您应该能够在目标设置中再次添加框架。
回答by CGee
If you haven't emptied your trash, you'll find your frameworks there. In case the deleted frameworks are iOS frameworks just copy/move them back from your trash to your XCode frameworks directory, which would be the following for most installations to date (XCode 5 + iOS 7):
如果您还没有清空垃圾箱,您会在那里找到您的框架。如果删除的框架是 iOS 框架,只需将它们从垃圾箱复制/移回 XCode 框架目录,对于迄今为止的大多数安装(XCode 5 + iOS 7),这将是以下内容:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/
For OS X frameworks the path posted by 555nickmay be the right one (haven't tested that though):
/System/Library/Frameworks
对于 OS X 框架,555nick发布的路径可能是正确的(虽然尚未测试):
/System/Library/Frameworks
Btw: You can fast-open such paths by opening the finder and using the Shift+Cmd+G
shortcut.
顺便说一句:您可以通过打开查找器并使用Shift+Cmd+G
快捷方式来快速打开此类路径。
回答by Mann
Above method will not work if your xCode's location is different. For that Open xCode click top project blue icon. Click Target-> build Phases -> Link Binary With Libraries
如果您的 xCode 位置不同,上述方法将不起作用。对于该 Open xCode,单击顶部项目蓝色图标。单击 Target-> build Phases -> Link Binary With Libraries
Now right or control click any existing framework and Show in Finder.
现在右键或控制单击任何现有框架并在 Finder 中显示。
This way you will get all existing framework's default location. Now go to that location and add your deleted framework again.
这样您将获得所有现有框架的默认位置。现在转到该位置并再次添加已删除的框架。
Restart xcode then you will see your deleted framework as it was before.
重新启动 xcode 然后你会看到你删除的框架和以前一样。
回答by Faysal Ahmed
Ok. So if you have deleted the frameworks from finder as well as from trash here is a solution. If you have another version of xcode installed in your mac then open that. In any of your projects try to add any of the frameworks that you have recently deleted. right click on it and go to the finder window and copy it.
好的。因此,如果您已从 finder 和垃圾箱中删除了框架,这里是一个解决方案。如果您的 Mac 中安装了其他版本的 xcode,请打开它。在您的任何项目中,尝试添加您最近删除的任何框架。右键单击它并转到查找器窗口并复制它。
Now go to the xcode from where the frameworks have been deleted, go to the fnder window in the same process above and paste the framework yoy just copied. i had the same problem as yours and it helped me.
现在转到删除框架的 xcode,在上述相同过程中转到 fnder 窗口并粘贴刚刚复制的框架。我和你有同样的问题,它帮助了我。