Removing unused frameworks in Xcode?(删除 Xcode 中未使用的框架?)
问题描述
随着时间的推移,当您开发应用程序时,您会向其中添加新库,这些库需要新的框架才能正常工作.然后删除库,如果您像我一样忘记删除最初添加的框架.
Over time when you develop an application you add new libraries to it, new frameworks needed for the libraries to work. Then you remove libraries and if you are like me you have forgotten to remove the frameworks that you initially added.
有没有办法找出我的代码需要哪些框架才能运行?
Is there a way to find out what frameworks are needed for my code to function?
推荐答案
我只是从 Xcode 中的链接阶段(或 xcconfig,如果你在那里定义它们)中删除有问题的框架,然后根据 ld 的错误重新引入框架.
I just delete the questionable frameworks from the link phase in Xcode (or the xcconfig, if you define them there) and reintroduce the frameworks based on ld's errors.
如果您的目标是多个操作系统版本,那么构建和链接这些 SDK 可能是个好主意,因为事情可能会发生一些变化.
If you are targeting multiple OS versions, it may be a good idea to also build and link against those SDKs since things can move around a bit.
我通常也不会将静态库链接到它们的依赖项,而是将其保留给最终的可执行文件.
I also do not typically link static libraries to their dependencies, reserving that for the final executable.
该阶段完成后,您可以从 Xcode 项目中删除未链接的框架.
Once that phase is complete, you can remove the frameworks you do not link from your Xcode project.
这篇关于删除 Xcode 中未使用的框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:删除 Xcode 中未使用的框架?


基础教程推荐
- 在 iOS 7 下 CCMenu 错位 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 更改 UITableView 部分标题的颜色 2022-01-01
- UINavigationBar 隐藏按钮文本 2022-01-01
- Android - 如何在runOnUiThread 中将数据传递给Runnable? 2022-01-01
- 在视图控制器的宽度上水平均匀分布 UIButton 的最简单方法? 2022-01-01
- 从 UIWebView 访问元数据 2022-01-01
- UINavigationItem 的持久 rightBarButtonItem 属性 2022-01-01
- EditText 中的 setHintTextColor() 2022-01-01
- Firebase 云消息传递令牌未生成 2022-01-01