我有一个使用 CocoaPods 包含多个第三方框架的 Xcode 工作区.我想在其中一个依赖项中编辑一行源代码.但是,当我这样做时,Xcode 会警告我该文件已被锁定,并且我所做的任何更改都可能无法保存.所以我的问题是:当我运行 pod 安装/更新时,我对源代码的更改会被丢弃吗?如果没有,是否有任何其他可能与 CocoaPods 无关的场景会丢弃我的更改?最后,有什么好的方法可以让我编辑源代码而不会遇到此类问题?
提前致谢.
您不能对原始 Pod 文件进行更改.如果您想添加更多功能,则必须分叉该特定存储库.
请按照以下步骤操作:
<块引用>
pod 'GPUImage', :git => 'https://github.com/UserName/GPUImage.混帐'
您可以创建 Category (Objective C) 或 Extension (Swift) 来扩展或向现有类添加一些功能.
I have an Xcode workspace that uses CocoaPods to include several third-party frameworks. I would like to edit a line of source code within one of these dependencies. However, when I do so, Xcode warns me that the file is locked and that any changes I make may not be saved. So my question is: will my changes to the source code be discarded when I run a pod install/update? If not, is there any other scenario, possibly unrelated to CocoaPods, that would discard my changes? And finally, is there any good way that I can edit the source code without running into such problems?
Thanks in advance.
You can not make changes in Original Pod file. If you want to add some more features then you have to fork that particular repo.
Follow steps to do so :
pod 'GPUImage', :git => 'https://github.com/UserName/GPUImage.git'
You can create Category (Objective C) or Extension (Swift) to extend or add some features to existing class.
这篇关于从 CocoaPods 框架编辑锁定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!